The function scanf () and printf () are used to read and write data respectively in various formats specified by the programmer. Both functions can operate on any of the built – in – data types, including characters, strings and numbers.
scanf () is the general purpose formatted console input function. it can read in all of the built – in data types and automatically convert numbers into the proper internal format. The phototype is:
int scanf (char * control _ string, argument _list);
scanf () returns the numbers of data items successfully assigned a value. If an error occurs, EOF is returned.
The general from of scanf () is
scanf (“control string”, argument1, argument2……. argumentn);
The control string consists of individual groups of characters, with one character group for each input data item. Each characters group must begin with a percent sign (%). In its simplest from, a single character group will consist of the %sign, followed by a conversion character which indicates the type of the corresponding data item. Within the control string, multiple character group can be separated by whitespace characters (i.e., blank spaces, tabs or new line characters). The most frequently used conversion characters are listed in table.
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc