0 like 0 dislike
4.9k views
Show more...
[Exercise] Coding (C) - asked in Chapter 9: Functions by (5.2k points)
ID: 35785 - Available when: 2017-12-07 18:00 - Due to: Unlimited

edited by | 4.9k views

47 Answers

0 like 0 dislike
Hidden content!
#include ** * *** *
int delete_e(int arr[],int size,int position)
{
* * *** * * ** ** i;
* ** * *** ** ****** * ** > size)
* * * * *** * ** **
*** *** * *** * * ****** * * ** ** * **** * *** * * 0;
* **** *** * **
** ******* * * ** **** *
** * ** * *** * ***
* ** * * **** * * * ** ** * ** ** * ** ** = position; position < size; position++)
* ** * **** * ** * * * * * *** * *** * * ***
* * ** **** **** * ** ** * * ***** ** **** ** * ** *** **** ** * **** ** * * ***** **
* ********** ** *** ***** * * * * * ***
* * * *** **** * ** ** * * *** *** ** 1;
** ***** **** * ***
}

int main(void)
{
***** ** ******* * ** array[100], position, c, n;

*** ** *** * * *** ** * *** ***** &n); //Enter number of elements in array
** * ** ** ** ( c = 0 ; c < n ; c++ ) * ** * * * *** * * * array
* * * * * * * ** ***** * * * * ** ** ** * **** * *

* * * **** * **** ****** * *** ** ** * * * ** * ** * ** * * *** * **** * **** ** * ** the location where you wish to delete element

*** ** ** ** * *** * * * * * * * ** //If delete success then print the result
********* **** * **** * * *** * ****** * c = 0 ; c < n - 1 ; c++ ) * * **** * ** * * * * * ** * * ** ** * * * * ***** * *** * * ** the result array
* * * ** *** * ** * ** ***** *** * *** ** ** * **** * * ***** * * ", array[c]);
* ***** *** * *** ** * * ** * ******** ** * * * * ******** ** * * * * * * * *** *** * * **** * ***** * fail

** * * ** ** ** ** * 0;
}
answered by (-285 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
int * * arr[],int size,int position)
{
** * *** ** *** ** (position > size)
** **** * * * * ** * ** * * * * * ***** *** * ** 0;
****** ** * **** * * ****
* * ** ** ** *** * ******** ** * * ** * * *** ** ; position ** * * ** **** *
*** * * * * ** *** ****
* ** * * * ** *** * * * * ***** ******* * ***** * * * * * *
*** * ** *** * ** ** * * *
**** *** * ******* *** * 1;
}

int main(void)
{
* * ** * * * array[100], position, c, n;

** * * * ****** * * ** *** *** *** //Enter number of elements in array
*** **** ** **** ( c = 0 ; c < n ; c++ ) * * ***** *** * * * array
* *** ****** *** * * * * * ** ** * * * *** * *** ** *

****** * * * *** * ** ** *** ** *** **** ** *** ** ***** ** * * ** *** *** * ***** * * ** the location where you wish to delete element

** * *** *** ** * * * * * * * * //If delete success then print the result
* ** ** ** ** *** *** ** * * ** ** * * ** c = 0 ; c < n - 1 ; c++ ) * * * * **** * *** * * * * * * * *** * * ** * * * * **** the result array
**** * **** *** ** ** ** ** * *** * ** * **** ** ** ** * * ** ****** * ** ** * ", array[c]);
** ** *** * * ** * *** * * * ** ** *** * * * ** * * * ** ** * ** * *** ** * * ** * * ** **** * ** fail

* ** * *** **** * **** 0;
}
answered by (-127 points)
0 0
prog.c: In function 'main':
prog.c:17:4: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    scanf("%d", &n); //Enter number of elements in array
    ^~~~~
prog.c:17:4: warning: incompatible implicit declaration of built-in function 'scanf'
prog.c:17:4: note: include '<stdio.h>' or provide a declaration of 'scanf'
prog.c:25:14: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
              printf("%d ", array[c]);
              ^~~~~~
prog.c:25:14: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:25:14: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c:26:9: warning: incompatible implicit declaration of built-in function 'printf'
    else printf("Impossible position!");             //If fail
         ^~~~~~
prog.c:26:9: note: include '<stdio.h>' or provide a declaration of 'printf'
0 like 0 dislike
Hidden content!
#include ** **** * *
int * arr[],int size,int position)
{
* * * * * ****** * *** 0;
**** * * ***
** * *** *** * * ** **** ** **** * * ** **
* * * ** ** * ** * ** ** ** * 1;
}

int * * *
{
** * * * * * ** * * * position, c, n;

* * *** * **** * * ** **** * *** * * * ** //Enter number of elements in array
** * * ( c = 0 ; c < n ; c++ ) * * *** **** ** ** *** array
** * * ****** ** **** * * * * * *** ***** * ***** ** **

* * *** * *** * ** * * ***** * ** *** * * *** * * ** * * * **** ** *** * ** * * the location where you wish to delete element

** ** * ***** ******** * ** * *** * ** * //If delete success then print the result
** * * * **** **** * **** * ** c = 0 ; c < n - 1 ; c++ ) * **** ** *** * ** * * *** * * * * **** ** **** **** ** the result array
* * **** **** ** * ** * ***** * * ***** * * *** ** *** * * * * * * * *** **** * *** * * ** *** *
* * * *** * * ** ** * * * *** ** ** * * * * *** * *** *** **** *** ** * * *** * ** **** * ***** * * * * * * * fail

*** * ** * ****** * 0;
}
answered by (-32 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include *** * ***
int delete_e(int arr[],int size,int position)
{
* ***** * * * * i;
* ** * *** ** ** *** ** *** *
** * * * * * * * * * * **** **
*** ******* * * *****
* *** * * ** ****** ***** **** *** ** *
** ** * * **** *** * * ** ** * *** *** * * * * * *
* * * * *** * ** ** * ** *** *
** * * * * * *** * * **** ***** ** * * * ** ** * **** ** ** ***** * * * * ****
* ** * ** *** * ** ** * ** **
* * * ** **** *
***** * * *** ** *** * * *
*** * * * *******
* ***** * * ** ** ** * *** * * **** *** 0;
* **** * *** * *
}

int main(void)
{
* * * * ** ** * array[100], position, c, n;

* *** *** **** ** * ** * &n); //Enter number of elements in array
* * ** *** ( c = 0 ; c < n ; c++ ) * * * * * * **** * *** array
*** **** * ** * * ** * * * * ** * *** * &array[c]);

*** *** ** ** * ** *** ** ** &position); * ******** * * * ** **** * * * * * ** ** * the location where you wish to delete element

* ** * *** **** ** * * * * //If delete success then print the result
* * * ** * *** * ** *** ** * * * * * * ** c = 0 ; c < n - 1 ; c++ ) * * ** ** * ** *** * ** * * ** * * **** * * * ***** * * the result array
**** * * ** * * **** ** * * * * * * * * * ** * * ***** ** * * * * * ** * **** ", array[c]);
* *** *** * * *** * ** * *** ** * * position!"); *** * * ** * * ** * * * ** * * * ** * *** * * ** * fail

**** ******* * ** 0;
}
answered by (-255 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Correct output
Case 3: Correct output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include * * * * ****
int delete_e(int arr[],int size,int position)
{
* *** *** * *** i;
*** * * ***** * *** *** * *
**** *** ** * *
* * * *** * ** ** * * * *** * * ****** 0;
*** * *** ** *
*** * * ** * *** **
**** * * * * *
* **** ** **** *** * ***** * **** * ** * ** *** * * ** ** ****
*** ***** *** ** * * ** *** **** *** ** *** *** * **
* ****** ** **** ****
}

int main(void)
{
* ** **** ** ***** ** * arr[100], position, c, size;

***** ** ** * ** * * ** * * * ** ***** //Enter number of elements in array
* * **** * *** * * ( c = 0 ; c < size ; c++ ) ** *** ** *** * * **** *** * ** array
***** * * * * *** ** ** * * * * * * * * * * * * ****

** ** ** *** * ** * ****** ** * *** * ** ** ** **** ************ *** **** * **** * * * * **** * ** the location where you wish to delete element

* * ** ** * ** * ** * ** * //If delete success then print the result
*** ** * * * **** ********* * **** * * ***** c = 0 ; c < size - 1 ; c++ ) * * * * *** * ** * * * * * **** ** * ** ** ** * ** * the result array
*** * *** ** * * ** * *** ** * * * **** * ** * ** * * *** **** * ** * * * ", arr[c]);
* ******** * ** * * * ** ** * * * * ** * * * * ****** * * * ******** ** **** * ** ** * * **** * ** * *** **** fail

** * ** * * * *** * ** * 0;
}
answered by (-249 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include *** * **** * *
int ** ** ** * arr[],int size,int position)
{
*** * *** ** *** * ** * YOUR CODE HERE*/
* * * * * * * ** *** ******
* ** ** * *** ** * * * *** *** * ** * * ** 0;
*** * * **** **
** ** ** ** * ***
** * * *** * ** ** *** * ** **** * *** ** * ** *** **** * * **
** * ****** ** * * ** * *** * * ** * * ** *** ** * * * **
* ** ** **** ** *** ** **** 1;
* ** * **** **** *
* ** * **** * * OF YOUR CODE*/
}

int main(void)
{
* ** *** **** * array[100], position, c, n;

*** ***** * ** * * ** * **** *** //Enter number of elements in array
* * ** *** *** ** * ( c = 0 ; c < n ; c++ ) ** ****** *** * * * * array
* ** ** * ****** * * ** * * * * ** ** * ** ** **

**** * ****** * ** ****** * * ******* * **** * *** * ** ******** ** *** **** *** * ** * ** * the location where you wish to delete element

* * * * *** * * ** //If delete success then print the result
** ********* * ** ** * *** * * * **** c = 0 ; c < n - 1 ; c++ ) * ** ** * ** *** ****** * ***** *** ** * ****** * * * * ** *** * *** the result array
* ** * * * * * * * *** * *** * * ***** * * ** ** * ***** *** * * ** ** ** ", array[c]);
* ***** ** * ** *** * ******** ** ** ** *** **** * * ** ***** * ** ** * *** * * * ****** ******* ** * ** *** * ****** fail

** **** * *** 0;
}
answered by (-249 points)
edited by
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int delete_e(int arr[],int size,int position)
{
* * * * * * * YOUR CODE HERE*/
if ** ****** * * * * * *
* ******* * * ** ***** 0;
}else
{return 1;}






** * ** * *** OF YOUR CODE*/
}

int main(void)
{
* * * * * **** array[100], position, c, n;

** * *** ** ** *** * * **** *** * * * * ** * *** * * * * * * * **** ** * * * ** * **** ** ** *** ** * * ** * *** * ** ** * *** * * **** ** ****** ** * * * * * * ** ** * * ** * ** *** ** **** * * ** ** * ** **** *** * * * **** ** ** *** * ** *** * * ** * ** * * ** * * * * ** * * *** ** * ******* *** ** * ** ** ** * ** *** *** * *** ** * *** * * * * ** *** * * * ** ** ***** ** * ******* ** * * * ** * * * *** * * &n); //Enter number of elements in array

*** * ******** **** * * ** * ( c = 0 ; c < n ; c++ ) * *** * ****** * * **** * array
** * * ** ** * * * * *** **** *** * * * * &array[c]);



**** * *** * * * ** ** * * * ** * ** * ***** * * * ** * ****** ** ** *** * * * ** *** * ** * ** * * * *** * ** ***** *** * * ** * **** *** * ** * ** * * ** *** *** * * ** ** * * ** *** * * *** ** * * * * * ** * * * ***** * *** ** * * ** ** ** * * * * *** * * * *** * ******* * ** * * **** * * *** *** * * * * * * **** * * ** * **** **** * * ** * ** ** * ***** ** ** ** * * ** * ** ** ******* *** * &position); * *** *** * ** * ** ****** * * **** *** * the location where you wish to delete element

   if (delete_e(array,n,position)) //If delete success then print the result
******* ****** ** * ** * * * * * * ** c = 0 ; c < n - 1 ; c++ ) * * *** ** * ** ** ** ** **** ** ** * * ** * ** ******* the result array
* **** ****** ***** ** ** * ** ** * * * * ** * * ** *** * * * *** ** ** ****** ", array[c]);
** ** *** *** * ** * printf("Impossible position!"); ***** * ** ** * ******** * * ** * * ** * * *** * ** *** ** ******** fail

* * * **** * 0;
}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int delete_e(int arr[],int size,int position)
{
* * * *** ** * * *** YOUR CODE HERE*/
if * **** ** **** * **
*** * **** **** ** * *** * 0;
}else
{return 1;}






* *** * ** * OF YOUR CODE*/
}

int main(void)
{
* ** * * * * * array[100], position, c, n;

***** ** * ** ** * ** * * * **** ** ** **** * ** *** * *** * * ******* ** **** ** * * ** * * * ** *** ** ***** *** * * *** **** * * ** ***** * * *** ******* ** ****** **** * * * * * * *** **** ********** ** * *** **** * * ** ** * * ** * ** **** ** ** * * *** * * *** * *** * * * * * * ** *** * ** * ******* * * ** ** ******** * * * ** ** ** * ** * * *** ** *** *** * ** **** * * **** *** * ** * &n); //Enter number of elements in array

** * ****** *** * * * ( c = 0 ; c < n ; c++ ) * * * ** array
* * * ******* ***** ** ** ******* * ** * &array[c]);



** * * ** *** * ** ***** ** ** ** ** * ** * ** * * ** * **** * *** * ** * * * ** * * * *** ** *** **** * ***** * *** * * *** * *** * **** **** ** *** ** * * ** ** ******* *** ** *** ******** * * ****** ** ** * * * ** **** * ** * *** * **** *** * *** * *** *** * * * *** ** * * * * * ** * * ***** * ******** * * * *** ** * **** * *** **** ** *** ** * ******** ** **** ** *** * **** ** * *** * &position); * * ** * ** * **** * * *** *** ** * * ** * * ***** the location where you wish to delete element

   if (delete_e(array,n,position)) //If delete success then print the result
* ***** * ** *** * * * * * ** ** c = 0 ; c < n - 1 ; c++ ) * *** * ** * * * * * *** **** ** **** ** *** ** ** * * **** the result array
* * * ** * * ** * * **** ** *** ** *** * **** * ** * * ******** ** *** * * ** **** ", array[c]);
* *** ** *** * * * printf("Impossible position!"); * ***** *** **** ** **** * * * * *** * ** * ** * * * * **** *** fail

* * ** *** * * *** * * * 0;
}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int delete_e(int arr[],int size,int position)
{
* ** * *** *** * YOUR CODE HERE*/
if * * * * ** * ** * * *
**** *** ***** * ** *** * 0;
}else
{return 1;}






** * ** *** *** * OF YOUR CODE*/
}

int main(void)
{
***** *** **** ** * array[100], position, c, n;

**** * **** ***** ** ** * *** ** ** * ** * * * ** *** * * * *** *** ** ** * * * **** * ****** * ** * * *** * * *** ** * * *** ** * *** ** *** ** ***** * * * * *** ** ** * * * *** * * * * * ********* * * * ** * * * * * **** ** * ** * ** *** * ** ** *** * * ** *** *** **** * * * * *** ** ** * **** ** * ** ********* * * * * *** * * * **** ** * ***** *** ** * **** ****** ** ** ** * * *** &n); //Enter number of elements in array

* * * ** * * ** * * ** *** ( c = 0 ; c < n ; c++ ) *** * * ** * ** ** array
* * * ** ** ** * * ** * * *** * *** * * * ** **** &array[c]);



** * ** * * * ** * * * ** * ** ****** * * * *** **** *** ** * *** * ** * ** * * **** * * ** * * ***** ** *** * * * * * * *** * * *** *** ** ****** * * ** * ** * *** * * **** *** **** ** * ****** * * * * * ** ** ** ** *** ** * *** * ** **** * *** * * ** * ** ** * *** ** * * * ** * * ***** * * * * **** ** * ** **** **** ** * * ** ** *** **** ************ *** * * ** *** * * ** ** * ** **** * *** &position); ** * * * ** ** * * * *** * * ****** ** * the location where you wish to delete element

   if (delete_e(array,n,position)) //If delete success then print the result
* ** * * ****** * ** * * *** * * c = 0 ; c < n - 1 ; c++ ) * **** * *** * *** ******* * * **** ** ** ** ****** * ** the result array
** ** * * * ** * ** ** * ** * * *** ** ** * * ** * ******* **** * * *** ", array[c]);
** ** ****** * *** printf("Impossible position!"); * * * * ** * **** ** ** ** ****** * **** *** ** fail

* **** * *** * * *** 0;
}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include * **** * **
int delete_e(int arr[],int size,int position)
{
* * *** * * * * * ** i=1;
**** * ** * *** * * * * *** * * **
** ****** * ** ** ** ** ** * ** * ***** 0;
* * ** ** *** *****
* ******** *** *
* * * * * * ** * * ** ** ** ** * ** *** * *
* * * * **** * * * * ** ** *** * *** * * ** ** ** ** * ** **** * ****
* ** * * ** * ** * ** ** * **** * *
* **** ** **** **** ***** ** *** ** * *** **** **
* ** **** * ****** ** * ** * * *** * * * * ***** * * * 1;
****** * * *** **
}

int main(void)
{
* *** * * **** ** array[100], position, c, n;

****** ** * ****** ** * **** * * &n); //Enter number of elements in array
* *** * * ** ** * ( c = 0 ; c < n ; c++ ) ** * * ** * * ********* ** * ** array
* **** *** ** * * * **** * * ** * ** * *** * &array[c]);

* ** ** * * **** **** ** * ** *** &position); ****** * ** * ********* * *** * * *** the location where you wish to delete element

** ** * * *** * * * * * * * ** * //If delete success then print the result
* * * ** **** * ** * ** **** * *** * * * c = 0 ; c < n - 1 ; c++ ) * **** * * ** * * **** ** ** * ** * *** **** *** *** * * the result array
** *** **** * *** ** * ** ***** * * *** * * ****** *** ** * *** * * ** * ", array[c]);
* ** * * ** ***** * * ** * ** ** position!"); *** ** ****** ** ** ** * * * ** * * * ** *** * **** ** * * **** fail

* * ** * * * * 0;
}
answered by (54 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.131.115
©2016-2025

Related questions

0 like 0 dislike
45 answers
[Exercise] Coding (C) - asked Dec 7, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 35784 - Available when: 2017-12-07 18:00 - Due to: Unlimited
| 5.5k views
0 like 0 dislike
79 answers
[Exercise] Coding (C) - asked Dec 28, 2017 in Chapter 9: Functions
ID: 39986 - Available when: Unlimited - Due to: Unlimited
| 10.3k views
0 like 0 dislike
70 answers
[Exercise] Coding (C) - asked Dec 7, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 35783 - Available when: 2017-12-07 18:00 - Due to: Unlimited
| 7.4k views
12,783 questions
183,442 answers
172,219 comments
4,824 users