Difference between printf() and puts()
Contents
Difference between printf() and puts() in Tabular Form
The Key Difference between printf() and puts() is that printf() is used to display all types of data and messages. While puts() is used to display only string data and messages.

Comparison Chart
printf() | puts() |
---|---|
It is used to display all types of data and messages. | It is used to display only string data and messages. |
It requires a format specifier to display formatted data. | It does not require a format specifier to display string. |
It can display multiple data at a time by multiple format specifiers in one printf( ). | It is used to display only one string at a time. |
Syntax:
|
Syntax:
|
Example:
int x,y; printf ("%d%d",x,y);
|
Example:
char ch[]="Hello"; puts(ch);
|