Program 5: Accept a character from the keyboard and display its previous and next character. #include<stdio.h> void main()...

C Program to find previous and next character of entered character.



Program 5: Accept a character from the keyboard and display its previous and next character.

#include<stdio.h>
void main()
{
    char ch;
    printf("Enter Character:");
    scanf("%c",&ch);
    printf("\nPrevious character of  %c is %c",ch,ch-1);
    printf("\nNext character of %c is %c",ch,ch+1);
}

Output
Enter Character: r
Previous character of r is q
Next character of r is s ✔




0 coment�rios:

HTML5 CSS3 TUTORIAL FOR BEGINNERS