C program to check whether a character is alphabet, digit or special character

/*write a program to accept a number and check if it is capital letter , small letter ,digit or special symbol */

#include<stdio.h>

#include<conio.h>

void main()

{            char ch;

             printf(" \n Enter a character :-");

             scanf(" %c",&ch);

             if(ch>=65 && ch<=90)

                        printf("\n %c is capital ",ch);

            else if( ch>=97 && ch<=122)

                         printf("\n %c is small ",ch);

            else if( ch>=48 && ch<=57)

                         printf("\n %c is Digit ",ch);

            else

                         printf("\n %c is special symbol ",ch);

            getch();

}

/* Output:--

                   Enter a character :- h

                   h is small

                   Enter a character :- 8

                   8 is Digit

                   Enter a character :- G

                   G is capital

                   Enter a character :- +

                   +  is special symbol

*/ 


                                                            👇💬💭😊👌

No comments:

Post a Comment

This Blog helps you to learn basics to high level programming coding and practicals.
conceptual understanding

c program, Advance coding, c++ program, simple program, Advance language

online quiz Application project page MCA final year project

  Here we making a quiz application ppt presentation for college project so that our project idea will like to our professor and teacher  fi...