WAP to take any single alphabet as input and find out if user has entered it in upper case or lower case using switch.
WAP to take any single alphabet as input and find
out if user has entered it in upper case or lower case using switch.
#include<stdio.h>
#include<conio.h>
void main()
{
int j;
char i;
clrscr();
printf("Enter the Alphabet ");
scanf("%c",&i);
if(i>='A' && i<='Z')
j=1;
else if(i<'z' && i>='a')
j=2;
switch(j)
{
case 1:printf("Upper case");
break;
case 2:printf("Lower Case");
break;
default:printf("Wrong input");
}
getch();
}
#include<conio.h>
void main()
{
int j;
char i;
clrscr();
printf("Enter the Alphabet ");
scanf("%c",&i);
if(i>='A' && i<='Z')
j=1;
else if(i<'z' && i>='a')
j=2;
switch(j)
{
case 1:printf("Upper case");
break;
case 2:printf("Lower Case");
break;
default:printf("Wrong input");
}
getch();
}