C Language

Scanf Function

In C Language by Baqir AliLeave a Comment

Scanf() Function in C

The function scanf (scan-eff) is used for reading data from standard input (usually the terminal). A call to this function takes the general form:

 scanf(format_string, &arg1, &arg2, …) 

where format_string refers to a character string containing certain required formatting information, and arg1, arg2, etc., are arguments that represent the individual input data items.

The format string consists of individual groups of characters, with one character group for each data input item. In its simplest form, each character group consists of a percent sign (%), followed by a set of conversion characters which indicate the type of the corresponding data item. The arguments are a comma-separated list of addresses.

Printf, Scanf live code example

Support us by sharing this post

About the Author

Baqir Ali

Facebook Twitter

Hi, I am Baqir Ali ---- Blogger, Programmer, and a Teacher. I am currently working as a Programmer for Softnat Technologies. I have tons of ideas and data to share with you all via blogging.

Leave a Comment