printf() and scanf() - Students Free Notes

Differentiate between printf() and scanf() functions.

printf() is used to display output to the screen, whereas scanf() is used to take input from the user. printf() formats and outputs data, while scanf() reads and stores data from the user into variables.Example: int num; scanf(“%d”, &num); // User input is stored in ‘num’ printf(“You entered: %d”, num); // Output the value of … Read more