Any character is entered through the keyboard, write a program in C to determine whether the character entered is a capital letter, a small letter, a digit or a special symbol

Any character is entered through the keyboard, write a program in C to determine whether the character entered is a capital letter, a small letter, a digit or a special symbol

            #include<stdio.h>
            #include<conio.h>
            void main()
            {
                        int a; char ch;
                        clrscr();
                        printf("\nEnter a character : ");
                        scanf("%c",&ch);
                        a=ch;
                        if(a>=65 && a<=90) {
                        printf("\nUppercase Letter");
                        } else if (a>=97 && a<=122) {
                                    printf("\nLowercase Letter");
                        } else if (a>=48 && a<=57) {
                                    printf("\nDigit");
                        } else {
                                    printf("\nSymbol");
                        }
                        getch();
            }


Post a Comment