putchar(variable ) and printf("%c", variable) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

putchar(variable ) and printf("%c", variable)

What is the difference between putchar() and printf("%c", variable), as both do the same thing.

12th Feb 2019, 11:52 PM
Talha Razzaq
Talha Razzaq - avatar
1 Answer
+ 4
In this particular case, they do almost the same, except: - putchar(c) returns the char written. - printf returns the total number of characters written. printf is more resource hungry... :) https://code.sololearn.com/c455sweP3WyD/?ref=app
13th Feb 2019, 3:32 AM
unChabon
unChabon - avatar