+1 vote
195 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 111 views
0 votes
1 answer 129 views
0 votes
1 answer 113 views
+1 vote
1 answer 171 views
0 votes
1 answer 218 views
+1 vote
1 answer 107 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

554 users

...