0 votes
219 views
in C program by (98.9k points)
edited
What is the purpose of printf() and scanf() in C Program?

1 Answer

0 votes
by (1.7k points)
selected by
 
Best answer

printf() is used to print the values on the screen. To print certain values, and on the other hand, scanf() is used to scan the values. We need an appropriate datatype format specifier for both printing and scanning purposes. For example,

  • %d: It is a datatype format specifier used to print and scan an integer value.
  • %s: It is a datatype format specifier used to print and scan a string.
  • %c: It is a datatype format specifier used to display and scan a character value.
  • %f: It is a datatype format specifier used to display and scan a float value.

Related questions

+1 vote
1 answer 153 views
+1 vote
1 answer 172 views
+1 vote
1 answer 196 views
0 votes
1 answer 79 views
0 votes
1 answer 129 views
0 votes
1 answer 204 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

557 users

...