
#include <stdio.h>
void main()
{
char c;
printf("Enter the character : \n");
scanf("%c", &c);
printf("You entered: %c\n", c);
printf("The previous character : %c\n", c - 1);
printf("The next character : %c\n", c + 1);
}
Output :
Enter the character : B
You entered: B
The previous character : A
The next character : C
Справочная ссылка