scanf() allows us to enter data from keyboard that will be formatted in a certain way.
The genaral form of scanf() statement is as follows :
scanf("format string",list of addresses of variables); For example: scanf("%d %f %c",&c &a &ch);
Note that we are sending addresses of variables (addresses are obtained by using '&' the 'address of' operator) to scanf() function. This is necessary because the values received from keyboard must be dropped into variables corresponding to these addresses. The values that are supplied through the keyboard must be separated by either blank(s), tab(s), or newline(s). Do not include these escape sequences in the format string.
gets() receives a string from the keyboard. scanf() has some limitations while a receiving a string of characters.There is no way to enter a multi-word string into a single variable. gets() function gets a string from the keyboard and it is terminated when an Enter Key is hit.Thus, spaces and tabs are perfectly acceptable as part of the input string. gets() gets a newline ( ) terminated string of characters from the keyboard and replaces the with a