Answer :
#include<stdio.h> //header file contains the function,decleraction and macro defination of key words used in code.
int main ()
{
char a; //adressing the variables
printf("Enter any alphabet or a number you like\t"); //output
scanf("%c",&a); //stores the input from the user
if (a>=97&& a<=122 || a>=65 && a<=90) //condition
{
printf("%c is an alphabet",a); //output
if (a>=97 && a<=122)
{
a=a-32;
printf("The character is converted into upper case is %c",a);
}
else
{
a=a+32;
printf("The character is converted into Lower case is %c",a);
}
}
else if (a>=48 && a<=57) //condition
{
printf("%c is number",a); //output
}
else
{
printf("%c is a symbol",a); //output
}
}
Output :
0 Comments