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 25 May 2020

C++ ctype.h Library Function | C++ ctype.h Library Function Programming Language | C++ ctype.h Library Function With Example

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.

 

image of C++ ctype.h Library Function

Fig: C++ ctype.h Library Function

1.    isalnum()

check whether character is alphanumeric.


Program:

#include<iostream.h>

#include<conio.h>

#include<ctype.h>

void main()

{

int   ch;

cout<<“Input string”;

if(isalum(ch))

cout<<“the int”;

else

cout<<”the alphabet”;

getch();

}


Output:

Input string

a

the alphabet

2.isalpha()

Check whether character is alphabetic.


Program:

#include<iostream.h>

#include<conio.h>

#include<ctype.h>

void main()

{

char   dwivedi;

cout<<“Input string”;

cin>>dwivedi;

if(isalph(dwivedi))

cout<<”the character is alphabet”;

else

cout<<”the alphabet is not a character ”;

getch();

}


Output:

Input string

Dwivedi

The character is alphhbet


3.isdigit()

Check whether character is digit.


Program:

#include<iostream.h>

#include<conio.h>

#include<ctype.h>

void main()

{

char   ch;

cout<<“Input value”;

cin>>ch;

if(isdigit(ch))

cout<<“the  alphabet is digit”;

else

cout<<“the alphabet is not a digit”;

getch();

}


Output:

Input value

Ram

The alphabet is not a digit


4.islower()

Convert to lowercase.


Program:

#include<iostream.h>

#include<conio.h>

#include<ctype.h>

void main()

{

char   ch;

cout<<“Input value”;

cin>>ch;

if(islower(ch))

cout<<“the  alphabet is lower case”;

else

cout<<“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<iostream.h>

#include<conio.h>

#include<ctype.h>

void main()

{

char   ch;

cout<<“Input value”;

cin>>ch;

if(isupper(ch))

cout<<“the  char is upper case”;

else

cout<<“the char is not uppercase”;

getch();

}


Output:

Input value

RAM

The char is upper case

 


No comments:

Post a Comment