+1 vote
163 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 99 views
0 votes
1 answer 105 views
0 votes
1 answer 97 views
+1 vote
1 answer 157 views
0 votes
1 answer 202 views
+1 vote
1 answer 97 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

535 users

...