c print char
Sure! Here is an example of how you can print a character in C:
#include <stdio.h>
int main() {
char myChar = 'A';
printf("%c\n", myChar);
return 0;
}
This code declares a variable myChar
and assigns it the value 'A'
. The printf
function is then used to print the value of myChar
as a character. The %c
format specifier is used to indicate that the argument to be printed is a character. Finally, the \n
character is used to print a newline after the character is printed.