Entered Character is digit or uppercase alphabet or lowercase alphabet
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("enter the character\n");
scanf("%c",&ch);
if(ch>='0'&& ch<='9')
printf("\nIt is adigit");
if(ch>='A'&&ch<='Z')
printf("\n It is alphabet");
if(ch>='a'&&ch<='z')
printf("\nit is alphabet");
getch();
}
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("enter the character\n");
scanf("%c",&ch);
if(ch>='0'&& ch<='9')
printf("\nIt is adigit");
if(ch>='A'&&ch<='Z')
printf("\n It is alphabet");
if(ch>='a'&&ch<='z')
printf("\nit is alphabet");
getch();
}
Can u plz give the same program including special character
ReplyDeletei wnt this progrm ith nested if no use of @ny logicl oper@tors
ReplyDelete