Tuesday, 7 April 2015

C Program to display ASCII value of a Character, it's next character, and it's previous character.

#include<stdio.h>
#include<conio.h>
main()
{
                char c;
                clrscr();
                printf("Enter the character\n");
                scanf("%c",&c);
                printf("\n The ASCII value of %c is %d",c,c);
                printf("\n Previous character of %c is %c",c,c-1);
                printf("\n Next Character of %c is %c",c,c+1);
} 

No comments:

Post a Comment