Friday, 12 August 2016

How to take input from user in c program

Syntax: 

scanf("%d  %f  %c", &a,&b,&c);


Here we have assumed that variable like a,b,c have been declared.
So what this does:


when you run the program , you will be asked three values " in order " , first you will enter value of a then value of b ,value of c .(Remember the order.) 


Don't miss the "&" symbol before the variable , we will  discuss some time later .
 

No comments:

Post a Comment