ms_shubha
asked on
Puts and Printf
What is the difference between puts and printf?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Puts prints a string and also printf when we give %s.So I wanted to know what exactly is the difference between the two.He gave a perfect answer.Thank you.
printf can be used to print (formatted and unformatted both) ..any data.. string .. character,double,float, ...
for
char *str;
puts(str) will be equivalent to
printf("%s\n",str);