Comparison of puts() and printf() functions in C


S.No. puts() printf()
1 Syntax: int puts(const char *str); Syntax: int printf(constant char *control_string, …);
2 Requires less overhead while calling Requires more overhead while calling
3 Can’t output numbers Can output numbers
4 Can’t do format conversions Can do format conversions
5 Takes less space Takes more space
6 Executes faster Executes slower

Leave a Reply