2/21/2009

C Program To Print ASCII Code For The Given Character



    /*Write a c program to print ASCII
      code for the given character */
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char c ;
    printf("Enter a character :\n");
        c=getchar();
    printf("ASCII value for %c is %d \n",c,c);

    return 0;
}
Out Put:
Enter a character :
g
ASCII value for g is 103

No comments:

Post a Comment