Program To Take Input From User

To receive or get input from the user in C programming, use the function scanf() to scan (receive/get) user input. The scanf() method, in C, reads the value from the console as per the type specified.

Syntax:

where %X is the format specifier in C. It is a way to tell the compiler what type of data is in a variable and & is the address operator in C, which tells the compiler to change the real value of this variable, stored at this address in the memory.

How to take input of basic types?

The basic type in C includes types like int, float, char, etc. In order to take input the specific type, the X in the above syntax is changed with the specific format specifier of that type.

The Syntax for input for these are:

Example:

Top Book Suggestion

The two books on C Programming Language that I Personally Recommend. I really loved reading these books. These books are listed for quality content, easy steps, and affordable price. You can get it from Amazon and Flipkart. 

 

Check The Price On Amazon:

1. C Programming Beginner’s Guide

2. Head First C: A Brain-Friendly Guide

Check The Price On Flipkart:

1. Introduction to C Programming 

2. Head First C: A Brain-Friendly Guide

Pin It on Pinterest

Share This