how to use character for output?

Recommended Answers

printf("%c",x);

where x is any character variable which is defined like this :

char x;

hope it helps!! thanks.

Jump to Post

All 4 Replies

Member Avatar

Be clear with your question.

printf("%c",x);

where x is any character variable which is defined like this :

char x;

hope it helps!! thanks.

With reference to ur query,
int main()
{
char ch='a';
clrscr();
printf("%c",ch);
getch();
return 0;
}
as u said use character for output.
here ch is a variable.
a is stored in ch variable.
ch is holding the result of a.
that variable is used as input for printing data on console.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.