To enter any character and display its ASCII value

 Program:

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
        char ch;
        clrscr();
        printf("Enter any Character             : ");
        scanf("%c", &ch);
        printf("ASCII Value of Given Character is : %d",  ch);
        getch();
    }

Output:

Enter any Character                         :  A
ASCII Value of Given Character is : 65



Previous Topic :  gets function

No comments:

Post a Comment