What is Character Type - C Data Type

C examples for Data Type:char

Introduction

You can specify the initial value for a variable of type char by a character constant.

A character constant is a character written between single quotes.

Here are some examples:

Demo Code

#include <stdio.h> 
  
int main(void) 
{ 
    char letter = 'A';
    char digit = '9';
    char exclamation = '!';

    //www  . j  a v  a  2  s . c  o  m
    printf("The character is %c\n", exclamation);
  
    return 0; 
}

Result


Related Tutorials