+1 vote
201 views
in C program by (3.4k points)
edited

What is the difference between printf() and puts() ?

1 Answer

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

The function printf() writes the data on standard output device with the ability of formatted string using %c, %d, %s, %20s .. etc and printf does not add new line after displaying text.

 int printf(const char *format, ...);

puts() writes the string on standard output device and add new line after displaying text.

 int puts(const char *s);

Related questions

0 votes
1 answer 120 views
0 votes
1 answer 137 views
0 votes
1 answer 119 views
+1 vote
1 answer 177 views
0 votes
1 answer 224 views
+1 vote
1 answer 113 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

561 users

...