scanf() is basically a function declared in stdio.h and it takes input from standard input stream i.e keyboard and places it in the desired location. scanf() has two parts : 1. Format string 2.