WAP to check whether a character is Uppercase or Lowercase alphabet

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


#include<stdio.h>

int main() {
   char ch;

   printf("\nEnter The Character : ");
   scanf("%c", &ch);

   if (ch >= 'A' && ch <= 'Z')
      printf("Character is Upper Case Letters");
   else
      printf("Character is Not Upper Case Letters");

   return (0);
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include<stdio.h>

int main() {
   char ch;

   printf("\nEnter The Character : ");
   scanf("%c", &ch);

   if (ch >= 65 && ch <= 90)
      printf("Character is Upper Case Letters");
   else
      printf("Character is Not Upper Case Letters");

   return (0);
}


Output :

1
2
Enter The Character : A
Character is Uppercase Letters

Comments

Most Viewed

Write C program to enter any year and check whether year is leap year or not using conditional/ternary operator.

WAP to input week number and print week day name.

C Program to Find Third Angle of a Triangle