scanf(), printf() Function in C


The scanf function allows you to accept input from standard in, which for us is generally the keyboard. The scanf function can do a lot of different things, but can be unreliable because it doesn’t handle human errors very well. But for simple programs it’s good enough and easy to use.

Example 1:


 Enter 1st numbers : 4
 Enter 2nd numbers : 16
 Addition is : 20

Example 2:


 Enter any positive integer: 6

 Factorial of 6 is 720