0
How do you retrieve input in C?
Hello, i'd like to know how to read input from the console in C. Please help me.
1 Odpowiedź
+ 3
You have to declare the variables first to store user input.For integers use:
int var_name = 0;
scanf("%d",&var_name);//to get user input
printf("%d",var_name);
For string use %s and no need to add ampersand sign.