Here are some example programs with example runs to show how scanf
either works or fails.
/****************************************/
/* Example 1 */
/****************************************/
#include
main ()
{
int i = 0;
char ch = ’*’;
float x = 0;
scanf ("%d %c %f",&i,&ch,&x);
printf ("%d %c %f\n",i,ch,x);
}
This program just waits for a line from the user and prints out what it
makes of that line. Things to notice about these examples are the way in
No comments:
Post a Comment