Determine character is a capital, small case, digit or special symbol.. .


/* write a program to accept a character and check if it is capital letter, digit or special symbol using library function */

#include<stdio.h>

#include<conio.h>

#include<ctype.h>   /*is used to support character function */

void main()

{          char ch;

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

            scanf(" %c",&ch);

            if(isupper(ch))

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

            else if(islower(ch))

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

            else if(isdigit(ch))

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

            else

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

           getch();

}

/* output:--

                 Enter a character :-- *

                * is special symbol

                Enter a character :-- B

                B is capital

                Enter a character :-- 5

                5 is Digit

                Enter a character :-- a

                a is small

*/

                                                

                                                        👇💬💭💗😊

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...