Have a Read!

Hi Everyone.
The idea for this page is to provide new c users simple c tutorials to learn how to develop the logic and more importantly correct way to write syntax.
ENJOY !!!

Tuesday, January 25, 2011

C PROGRAM TO RECEIVE MULTIPLE INPUTS

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

Related Posts with Thumbnails