TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Monday, 11 May 2020

Ctype.h Library Function In C language | Ctype.h Library Function In C language In Hindi

C-ctype.h Library Function


All inbuilt function which are declared in ctype.h header file are there and they are

   1.    isalnum()
   2.    isalpha()
   3.    isdigit()
   4.    islower()
   5.    isuper()

Now will define the ctype function.

download image of ctype library function in c

Fig: ctype.h function 

1.    isalnum()

check whether character is alphanumeric.


Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
int   ch;
printf(“Input string”);
if(isalum(ch))
printf(“the int”);
else
printf(“the alphabet”);
getch();
}

Output:

Input string
a
the alphabet


2.isalpha()

Check whether character is alphabetic.


Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char   dwivedi;
printf(“Input string”);
scanf(“%c”, &dwivedi)
if(isalph(dwivedi))
printf(“the character is alphabet”);
else
printf(“the alphabet is not a character ”);
getch();
}


Output:

Input string
Dwivedi
The character is alphhbet


3.isdigit()

Check whether character is digit.


Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char   ch;
printf(“Input value”);
scanf(“%c”, &ch)
if(isdigit(ch))
printf(“the  alphabet is digit”);
else
printf(“the alphabet is not a digit”);
getch();
}


Output:

Input value
Ram
The alphabet is not a digit


4.islower()

Convert to lowercase.


Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char   ch;
printf(“Input value”);
scanf(“%c”, &ch)
if(islower(ch))
printf(“the  alphabet is lower case”);
else
printf(“the char is not in lower case”);
getch();
}


Output:

Input value
Ram
The alphabet is lower case


5.isupper()

Covert into upper case.


Program:

#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main()
{
char   ch;
printf(“Input value”);
scanf(“%c”, &ch)
if(isupper(ch))
printf(“the  char is upper case”);
else
printf(“the char is not uppercase”);
getch();
}


Output:

Input value
RAM
The char is upper case

No comments:

Post a Comment