Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

First ask the user how many numbers (num), up to 20, they wish to enter. Then pr

ID: 3631116 • Letter: F

Question

First ask the user how many numbers (num), up to 20, they wish to enter. Then prompt the user for num numbers, storing them in an array. Finally print the numbers in reverse, separated by a comma and a single space, on a single line.

You should declare an array:

int numbers[20];
but use num to keep track of how many valid entries you have.

Constraints

Do not output a comma after the last number.
If the user enters an invalid number of entries, prompt them to try again.

Explanation / Answer

#include int main(void) { int numbers[20], num; do { printf("Enter a positive number less than 20: "); scanf("%d", &num); } while( num < 0 || num > 20); // Getting the numbers for(i = 0; i