Enter an ASCII code value, such as 66, and then prints the character having that ASCII code. - C Data Type

C examples for Data Type:char

Description

Enter an ASCII code value, such as 66, and then prints the character having that ASCII code.

Demo Code

#include <stdio.h>  

int main(void) {  
    int ascii;  //from  w  w w . j a v a  2s . com
      
    printf("Enter an ASCII code: ");  
    scanf("%d", &ascii);  
    printf("%d is the ASCII code for %c.\n", ascii, ascii);  
    return 0;  
}

Result


Related Tutorials