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);
}
OUTPUT :
Enter the character
s
The ASCII value of s is 115
Previous character of s is r
Next Character of s is t
s
The ASCII value of s is 115
Previous character of s is r
Next Character of s is t