C – User Input

To get user input in C language, use the scanf(). It is used to read the data input by the user on the console. Let us see some example C programs to get input from the user.

C program to print an integer entered by the user

Let us see an example to enter an integer from the user using scanf() and display using printf():

Output

C program to print the multiplication of integers entered by the user

Let us see another example wherein we will get three numbers from the user and multiply them:

Output

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:


For Videos, Join Our YouTube Channel: Join Now


Read More:

Strings in C
C - Functions
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading