0 votes
502 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 418 views
+1 vote
1 answer 445 views
+1 vote
1 answer 502 views
0 votes
1 answer 352 views
0 votes
1 answer 374 views
0 votes
1 answer 517 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!

Recent Badges

Doubtly Earned a badge
Doubtly Earned a badge
Doubtly Earned a badge

5.7k questions

5.1k answers

108 comments

648 users

...