FY_BCA_C_SLIP_22



/* Slip no :22_1 write prog to accept chatacter from user and check it is alphabet,digit or punctuation symbol
if it alphbet check it is lower case or upper acse and then change it's case*/

#include<stdio.h>
#include<conio.h>

int main()
{
                char ch;
                printf("\n Enter character : ");
                scanf("%c",&ch);

                if(isdigit(ch))
                                printf("\n Given charcter is digit") ;
                else if(isalpha(ch))
                {
                                printf("\n Given character is alphabet");
                                if(islower(ch))
                                {
                                                printf("\n Change case is %c ",toupper(ch));
                                }
                                else
                                                printf("\n Change case is %c ",tolower(ch));
                }
                else
                                printf("\n Given character is special symbol ");
                getch();
}

No comments:

Post a Comment