scanf is a function that reads data with specified format from a given string stream source, originated from C programming language, and is present in many other programming languages.
The scanf function prototype is:
int scanf (char *format, ...);
The function returns the total number of items successfully matched, which can be less than the number requested. If the input stream is exhausted or reading from it otherwise fails before any items are matched, EOF is returned.
So far as is traceable, "scanf" stands for "scan format", because it scans the input for valid tokens and parses them according to a specified format.
http://en.wikipedia.org/wiki/Scanf
ets is a function in the C standard library, declared in the header file stdio.h, that reads a line from the standard input and stores it in a buffer provided by the caller.
Use of gets is strongly discouraged. It is left in the C89 and C99 standards for backward compatibility. Many development tools such as GNU ld emit warnings when code using gets is linked.
The programmer must know a maximum limit for the number of characters gets will read so he can ensure the buffer is big enough. This is impossible without knowledge of the data. This design flaw leads to bugs and opens a gate for exploiting computer security through a buffer overflow. Many sources advise programmers to never use gets in new programs.[1][2][3]
http://en.wikipedia.org/wiki/Gets