The following code represents basic way to receive multiple inputs from user.It depends on the number of variables initialized. At this stage more variables initialized more inputs can be take from user.
#include <stdio.h>
int main () {
int a,b,c,d,e;
printf("PLEASE ENTER 5 NUMBERS\n");
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
printf("YOU HAVE ENTERED FOLLOWING NUMBERS:\n");
printf("First=%d \nSecond=%d \nThird=%d \nFourth=%d \nFifth=%d\n ",a,b,c,d,e);
return 0;
}
No comments:
Post a Comment