0 like 0 dislike

Please write a program using an array to receive 5 numbers, then output those inputs in reverse order as examples shown.

Input (i)

1 2 3 4 5

Input (ii)

1
2
3
4
5

 

Output (i) acceptable

54321

Output (ii) acceptable

5 4 3 2 1 

 

More information

https://www.tutorialspoint.com/cprogramming/c_arrays.htm

 

[Exercise] Coding (C) - asked in Chapter 4: Arrays by (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 89 views

17 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
* * ** * * **** ******* x[5], i;
* *** ** ***** * * *** * **
* *** * * ** *** ** *** * *
* *** *** * ** ** *** * *** * **** *** * ***** * &x[i]);
* * * ** ** * *** *** *** *** * ******* ** * **
** ***** ****** **
* * **** ** * ** * * ***
* ****** * * *** * ** **** ******
* ** *** * * **** *** ** * * ** **** *** * * * * ** * * * *
* ****** ** * *
********* ** * *** ** 0;
}
100/100 answered by (271 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
Case 4: Wrong output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
#include * * * * *** *
* * * ** **** * * * * *

int main(int argc, char *argv[]) {
** * * ** ** int x[5], i;
* * * * **
** **** * * * ******
***** * ** * ***** * ** **** ** *** *** * * * * *
* * * * * * * ** ** *
* *** * * }
* * * **
* * * ** *** *** * *
** ** *** * ** * *** ** *** **
* * * }
*** ** ** *** * return 0;
}
100/100 answered by (290 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
Case 4: Wrong output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(){

* * *** * ** * * * x[5], i;
* * * * ** ** * * * *
    
** * *** ** ** *** ** *** * *
* *** ** * * ** * * **** * * * * * ** ****** ** *** **** &x[i]);
** * ** ****** * ****
* * * ****** * ** ** *
* * * **** * * * *** ** * * * *
* * ** *** * * ** ***** *** * * ******* * ******* **** *** *** * x[i]);
* ** * * **** * * *
* *** *** * ** * **
******* * *** ** ** *** 0;
}
100/100 answered by (269 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
Case 4: Wrong output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(){

* * ****** * **** ** ***** x[5], i;
* ** ** *** ** * ***
    
* ** * * *** * **** *
** * ** * ** ***** * * * ***** * * * ** * * * * *** ** *** *** &x[i]);
* ****** ** * ** * ** ** *
* * * ** ********* *
*** * * *** *** ** ** *** *** ** *
* * * ** * * * ** ** ** * * **** * * *** ******** x[i]);
** * * ** ********* * * * **
* ***** * * ** **
***** ** *** * *** * * 0;
}
100/100 answered by (243 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
Case 4: Wrong output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
int main(){
** ***** ******* * * **** * *** ** * *** * x[5], i;
** ** * ** ** *
******* ****** ***** * * ** * *** * *** * * ** *** * * * * * **
    **** ** ** ** * &x[i]);
* * ** **** * * *******
** * * ** * * * ** * * * ** * * * * *
*** * * **** ** *** ** * * * ** ** *** * * * ", x[i]);
* * *** * * * * ** *
** * * * * ** *** ** *
* *** ** ** *** ***** * * *** * * 0;
}
100/100 answered by (220 points)
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Correct output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
#include * ** **** ***
int main(){

* *** *** int x[5], i;
***** * ** *
* * * ** *** * *
****** ** * *** * * *
** ** * * ** * * * ** ******* ******* * **** **
* ** * * * }
** ** * ***** *
* **** * * * ** ** * **
* * * * ** * ** * *** * * ** *** x[i]);
* * *** * }
* * ***** * **
** * ** ** return 0;
}
100/100 answered by (269 points)
0 0
Case 0: Correct output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Correct output
Case 4: Wrong output
Case 5: Wrong output
0 like 0 dislike
Hidden content!
* * * ** ***
****** ** * ** ** * * *

/* run *** * * the ** ** * or add * own * * ** * ** * *** or ** loop */

* * * **** ** ** * * * {
** * int *
**** * ** * a[0] = 4;
** *** *** * * = 2;
*** *** ** = 3;
* * * **** * * = 5;
* * * * = 6;
* ** ** ***
** * * * * ** * *** * from 1 to * *** *
**** *** *** * ** * * * * %d %d %d * ** * *** * * ** * * ** *** ** **
* * * *
** * *** * int x;
* ** **** * ** = 4; x * * 0; *
* * * * * ***** ** **** * *** ** *** * * * *** *
* * * }
**** ***** * * * * * * * * ** *** **

* *
* *** *** * * * 0;
}
100/100 answered by (252 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
0 0
Great job :)
0 0
However,     parts --a[0] = 4; a[1] = 2; a[2] = 3; a[3] = 5; a[4] = 6;-- seem unnecessary.
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.79.41
©2016-2019

Related questions

0 like 0 dislike
18 answers
[Exercise] Coding (C) - asked Jan 5, 2018 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 83 views
0 like 0 dislike
46 answers
[Exercise] Coding (C) - asked Dec 15, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 191 views
0 like 0 dislike
20 answers
[Exercise] Fill in the blank - asked Dec 15, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 69 views
0 like 0 dislike
18 answers
[Exercise] Fill in the blank - asked Dec 7, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 76 views
0 like 0 dislike
0 answers
[Resource] asked Jan 5, 2018 in Chapter 4: Arrays by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 13 views
8,749 questions
71,489 answers
46,327 comments
1,896 users