Advertisement
Unformatted Console Output Functions | Description |
---|---|
puts() | Displays a single string's value at the console. |
putch() | Displays a single character value at the console. |
putchar() | Displays a single character value at the console. |
/* Using puts() function to display a string*/
#include<stdio.h>
int main()
{
char country[20];
printf("Enter a country you want to visit : ");
gets(country);
printf("The country you want to visit is : ");
puts(country);
return 0;
}
Enter a country you want to visit : New Zealand
The country you want to visit is : New Zealand
Advertisement
#include<stdio.h>
#include<conio.h>
int main()
{
int ch = 'a';
printf("The character value printed using putch() : ");
putch(ch);
printf("\n");
printf("Another character value printed using putch() : ")
putch('B')
printf("\n");
printf("The character value printed using putchar() : ");
putchar(ch);
printf("\n");
printf("Another character value printed using putchar() : ")
putch('D');
return 0;
}
The character value printed using putch() :a
Another character value printed using putch() : B
The character value printed using putchar() : a
Another character value printed using putchar() : D
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement