[ create a new paste ] login | about

Link: http://codepad.org/3q3irTQN    [ raw code | output | fork ]

godneil - C, pasted on Nov 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//find ASCII value of a character
#include<stdio.h>

int main()
{
    char c;
    printf("Please enter a character: ");
    scanf("%c", &c);
    //%d integer value of the character
    //%c shows the actual character
    printf("The ASCII value of %c = %d", c, c);
    
    return 0;
}


Output:
1
Please enter a character: The ASCII value of  = 8


Create a new paste based on this one


Comments: