I am having issues with getting input numbers from keyboard and putting them into an array and displaying them in original order, ascending order, and descending order. I am stuck on getting the input from the keyboard. Is my scanf/printf statement incorrect?
Code:#include <stdafx.h> #include <stdio.h> #include <ctype.h> #define MAX_SIZE 5 int main (void) { //int nums[5] = {1, 2, 3, 4, 5}; int nums[5]; int i; //Statements printf ("Enter 5 numbers\n"); for (i = 0; i < 5; i++) scanf ("%d", &nums[5]); printf ("%d, %d, %d, %d, %d", nums[5]); return 0; }



LinkBack URL
About LinkBacks




