okI'm starting out small so please bear with me. This is what I have to do. C program that will accept up to 50 validated integers from the keyboard (a null entry terminates the input process), store the integers in a subscripted array, sort the array in ascending sequence, copy the sorted values to a linked list organized with pointers, and then display the values on the screen. so i have broken it into 6 step. So the first on i want to do is to input the intergerts into an array. I have lowed the number in the array to 5. So i need to know what i did wrong to get it into my array the first time
Code:#include <stdio.h> #define Max 5 //number to set array main () { int Num[Max]; // numbers to be added to array printf ("please enter 5 random nunber"); scanf ("%d", &Num); while (Num == NULL) { printf ("please enter 50 random nunber"); scanf ("%d", Num); } printf ("%d", Num); getchar(); return 0; }



LinkBack URL
About LinkBacks



You can't test a number before you set it to something. So, you could do as I suggested, or set each element of the array to a number other than zero before the loop.