Write a Program to Input an Alphabet from User
How to write a program to input an alphabet from user and print the alphabet before it and the alphabet after it?
Answers
Answered by
2
#include <stdio.h>
#include < >
void main(int argc, char *argv[])
{
char c;
printf("type a alphabet: ");
c = getchar();
if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' )
printf("char before: %c ... Char after: %c \n",c-1 , c+1);
else
printf("enter an alphabet only\n ");
}
#include < >
void main(int argc, char *argv[])
{
char c;
printf("type a alphabet: ");
c = getchar();
if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' )
printf("char before: %c ... Char after: %c \n",c-1 , c+1);
else
printf("enter an alphabet only\n ");
}
Similar questions