#include<stdio.h>
#include<conio.h>
int main()
{
char c='f';
putchar(c);
getch();
}
/* Syntax is as follows:-
putchar(variable name);*/
The above program is a simple example of how to use the putchar()
function in C programming. The putchar()
function is used to write a single character to the standard output stream (usually the console).
In the program, a character variable c
is initialized with the character ‘f’. The putchar()
function is then used to display the character ‘f’ to the console. The getch()
function is then used to pause the console until a key is pressed.
The syntax of putchar()
function is: int putchar(int character)
where character
is the integer representation of the character to be written to the standard output stream. It returns the integer value of the character that has been written.
Thanks
Write a program to use putchar() in work.