Showing posts with label capital. Show all posts
Showing posts with label capital. Show all posts

Wednesday, May 16, 2018

C program to check whether the given letter is small letter or capital letter.

Program code
#include <stdio.h>
#include <conio.h>
void main()
{
char letter;
clrscr();
printf("Please input an alphabet.\n");
scanf("%c",&letter);
switch(letter)
{
case 'a':printf("You have typed small letter.\n");
break;
case 'b':printf("You have typed small letter.\n");
break;
case 'c':printf("You have typed small letter.\n");
break;
case 'd':printf("You have typed small letter.\n");
break;
case 'e':printf("You have typed small letter.\n");
break;
case 'f':printf("You have typed small letter.\n");
break;
case 'g':printf("You have typed small letter.\n");
break;
case 'h':printf("You have typed small letter.\n");
break;
case 'i':printf("You have typed small letter.\n");
break;
case 'j':printf("You have typed small letter.\n");
break;
case 'k':printf("You have typed small letter.\n");
break;
case 'l':printf("You have typed small letter.\n");
break;
case 'm':printf("You have typed small letter.\n");
break;
case 'n':printf("You have typed small letter.\n");
break;
case 'o':printf("You have typed small letter.\n");
break;
case 'p':printf("You have typed small letter.\n");
break;
case 'q':printf("You have typed small letter.\n");
break;
case 'r':printf("You have typed small letter.\n");
break;
case 's':printf("You have typed small letter.\n");
break;
case 't':printf("You have typed small letter.\n");
break;
case 'u':printf("You have typed small letter.\n");
break;
case 'v':printf("You have typed small letter.\n");
break;
case 'w':printf("You have typed small letter.\n");
break;
case 'x':printf("You have typed small letter.\n");
break;
case 'y':printf("You have typed small letter.\n");
break;
case 'z':printf("You have typed small letter.\n");
break;
case 'A':printf("You have typed capital letter.\n");
break;
case 'B':printf("You have typed capital letter.\n");
break;
case 'C':printf("You have typed capital letter.\n");
break;
case 'D':printf("You have typed capital letter.\n");
break;
case 'E':printf("You have typed capital letter.\n");
break;
case 'F':printf("You have typed capital letter.\n");
break;
case 'G':printf("You have typed capital letter.\n");
break;
case 'H':printf("You have typed capital letter.\n");
break;
case 'I':printf("You have typed capital letter.\n");
break;
case 'J':printf("You have typed capital letter.\n");
break;
case 'K':printf("You have typed capital letter.\n");
break;
case 'L':printf("You have typed capital letter.\n");
break;
case 'M':printf("You have typed capital letter.\n");
break;
case 'N':printf("You have typed capital letter.\n");
break;
case 'O':printf("You have typed capital letter.\n");
break;
case 'P':printf("You have typed capital letter.\n");
break;
case 'Q':printf("You have typed capital letter.\n");
break;
case 'R':printf("You have typed capital letter.\n");
break;
case 'S':printf("You have typed capital letter.\n");
break;
case 'T':printf("You have typed capital letter.\n");
break;
case 'U':printf("You have typed capital letter.\n");
break;
case 'V':printf("You have typed capital letter.\n");
break;
case 'W':printf("You have typed capital letter.\n");
break;
case 'X':printf("You have typed capital letter.\n");
break;
case 'Y':printf("You have typed capital letter.\n");
break;
case 'Z':printf("You have typed capital letter.\n");
break;
default:printf("Invalid alphabet.\n");
break;
}
getch();
}

Example of output
Please input an alphabet.
a
You have typed small letter.