How do you retrieve input in C? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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.

11th Sep 2020, 4:41 PM
Luke
Luke - avatar
1 Réponse
+ 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.
11th Sep 2020, 4:55 PM
HBhZ_C
HBhZ_C - avatar