What is the difference between printf() and scanf() functions in C language?
A. printf() prints a formatted output to the standard output device (screen) and scanf() reads a formatted input from the standard input device (keyboard)
B. printf() reads a formatted input from the standard input device (keyboard) and scanf() prints a formatted output to the standard output device (screen)
C. printf() and scanf() both print a formatted output to the standard output device (screen)
D. printf() and scanf() both read a formatted input from the standard input device (keyboard)
Answer:A
What is the difference between printf() and scanf() functions in C language?
A. printf() prints a formatted output to the standard output device (screen) and scanf() reads a formatted input from the standard input device (keyboard) B. printf() reads a formatted input from the standard input device (keyboard) and scanf() prints a formatted output to the standard output device (screen) C. printf() and scanf() both print a formatted output to the standard output device (screen) D. printf() and scanf() both read a formatted input from the standard input device (keyboard)
Explanation: The C language's printf() and scanf() library functions are used for input and output operations. A format string and optional arguments are passed to printf(), which prints the results to the standard output area (screen). As an illustration, printf("%dn", x); outputs the value of x and the newline character. Using the keyboard as the standard input device, scanf() reads a format string, pointers to variables, and a format string. The command scanf("%d", &x); for instance, reads an integer value from the keyboard and stores it in the variable x.