How to Print Char Variable in C

In C language, you can use the printf function to output char type variables.

For example, suppose there is a character variable called ch, you can output its value as follows:

char ch = 'A';
printf("%c", ch);

In the above code, %c is the format specifier for the printf function, used to indicate outputting a character. “ch” is the variable of character type that will be output.

The output result will be the character A.

bannerAds