Check Whether Character is Uppercase or Not without using Library function

August 19, 2024 No Comments » Hits : 204





Program : Check Whether Entered Character is Uppercase Letter or Not Without using Library Function.
Way 1 :

#include<stdio.h>
void main()
{
char ch;
int i;
clrscr();
printf("\nEnter The Character : ");
scanf("%c",&ch);
if(ch>='A' &&ch<='Z')
  printf("\nCharacter is Uppercase Letters");
else
  printf("\nCharacter is Not Uppercase Letters");
getch();
}

Way 2 :

#include<stdio.h>
void main()
{
char ch;
int i;
clrscr();
printf("\nEnter The Character : ");
scanf("%c",&ch);
if(ch>=65 && ch<=90)
  printf("\nCharacter is Uppercase Letters");
else
  printf("\nCharacter is Not Uppercase Letters");
getch();
}

Output :

Enter The Character : A
Character is Uppercase Letters

Program Under Section : String Programs

Incoming search terms: