Monday 31 March 2014

C Program | To Find ASCII Value of a Character-Source code

C Program | To Find ASCII Value of a Character

Source code:-)

 /* Source code to find ASCII value of a character entered by user */

#include <stdio.h>
int main(){
    char c;
    printf("Enter a character: ");
    scanf("%c",&c);        /* Takes a character from user */
    printf("ASCII value of %c = %d",c,c);
    return 0;
}

Output:-)

Enter a character: G
ASCII value of G = 71

No comments:

Post a Comment