Home / Programs / Character format specifier : %c Example program
🚀 Programming Example

Character format specifier : %c Example program

👁 1,007 Views
💻 Practical Program
📘 Step Learning
Character format specifier : %c

💻 Program Code

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

🖥 Program 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>);
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.