Character format specifier : %c Example program

C Programming Language Overview of C Language (Article) Overview of C Language (Program)

905

Program:

#include <stdio.h> 
int main() 
{ 
    char ch = 'A'; 
    printf("%c\n", ch); 
    return 0; 
} 

Output:

A

Explanation:

Character Format Specifier %c

The %c format specifier is implemented for representing characters. This is used with printf() function for printing the character stored in a variable. When you want to print a character data, you should incorporate the %c format specifier.

Syntax:

 
 printf("%c",<variable name>);

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.