JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: c++ language in hindi

C++ : ctype class in hindi , what is ctypes class with program example in c++ language

what is ctypes class with program example in c++ language , C++ : ctype class in hindi :-
इससे पहले के article मे केवल string class के function को दिचुस किया है ?| अब इस article मे ctype class मे उपस्थित  member फ़ुन्क्तिओन्स को discuss किया जाता है |
ctype class
ctype class मे define function का use character पर किया जाता है | ये function का use character पर basic uppercase , lowercase को  check और convert करने के लिए किया जाता है |  नीचे इन्हें functions को discuss करेगे :-1.isalnum()
इस function से alpha numerical character को check करने  के लिए किया जाता है | अगर character alphabetnumerical होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा :
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string user_name ;
cout<<“Enter User name : “;
cin>>user_name;
int count =0;
int length = strlen(user_name);
for(int i =0;i<=length ; i++)
{
if (isalnum (user_name[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<“user_name is alphabetnumerical. “;
}
else
{
cout<<“user_name is not alphabetnumerical. “;
}
getch();
}
इस उदाहरन मे  user name को input किया जाता है |  और loop मे यूजर name के प्रत्येक character को inalnum() से check किया जाता है | अगर यूजर name में sepacial character होता है तब user_name is not alphabetnumerical. display होता है |

1.isalpha()
इस function से alphabetic character को check करने  के लिए किया जाता है | अगर character alphabetical होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा :
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string user_name ;
cout<<“Enter User name : “;
cin>>user_name;
int count =0;
int length = strlen(user_name);
for(int i =0;i<=length ; i++)
{
if (isalpha (user_name[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<“All Character are alphabets in user name . “;
}
else
{
cout<<“All Character are not alphabets in user name . “;
}
getch();
}
इस उदाहरन मे  user name को input किया जाता है |  और loop मे यूजर name के प्रत्येक character को inalpha() से check किया जाता है | अगर यूजर name में sepacial character होता है तब user_name is not alphabetical. display होता है |

3.isblank
इस function से blank character को check करने  के लिए किया जाता है | अगर argumnet मे blank character होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string user_name ;
cout<<“Enter User name : “;
cin>>user_name;
int count =0;
int length = strlen(user_name);
for(int i =0;i<=length ; i++)
{
if (isblank(user_name[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<“User name have blank character . “;
}
else
{
cout<<“User name have not  blank character .  “;
}
getch();
}
इस उदाहरन मे  user name को input किया जाता है |  और loop मे यूजर name के प्रत्येक character को inblank() से check किया जाता है | अगर यूजर name में कोई भी character blank space नहीं होता है तब User name have not  blank character .   display होता है |

4.isdigit
इस function से numerical character को check करने  के लिए किया जाता है | अगर argumnet मे  सभी character , numerical character होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string employee_ID ;
cout<<“Enter ID: “;
cin>>employee_ID;
int count =0;
int length = strlen(employee_ID);
for(int i =0;i<=length ; i++)
{
if (isdigit(employee_ID[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<” ID have digits only. “;
}
else
{
cout<<” ID have alphanumerical. “;
}
getch();
}
इस उदाहरन मे  ID को input किया जाता है |  और loop मे ID के प्रत्येक character को isdigit() से check किया जाता है | अगर यूजर name में कोई भी character digit होता है तब ID have digits only.display होता है |

इसके अलावा निन्म function को use किया जाता है :-
5.islower () :
इस function से lowercase character को check करने  के लिए किया जाता है | अगर argumnet मे  सभी character , lowercase character होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string name  ;
cout<<“Name : “;
cin>>name ;
int count =0;
int length = strlen(name);
for(int i =0;i<=length ; i++)
{
if (islower(name[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<“All Character are lower case. “;
}
else
{
cout<<” All Character are not lower case. “;
}
getch();
}
इस उदाहरन मे  name को input किया जाता है |  और loop मे name के प्रत्येक character को islower() से check किया जाता है | अगर यूजर name में कोई भी character lower case होता है तब All Character are lower case. display होता है |

6.isupper() :
इस function से uppercase character को check करने  के लिए किया जाता है | अगर argumnet मे  सभी character , uppercase character होता है तब ‘1’ return होता है अन्यथा ‘0’ return होगा
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string name  ;
cout<<“Name : “;
cin>>name ;
int count =0;
int length = strlen(name);
for(int i =0;i<=length ; i++)
{
if (isupper(name[i]))
{
count =1;
}
}
if(count == 1 )
{
cout<<“All Character are upper case. “;
}
else
{
cout<<” All Character are not upper case. “;
}
getch();
}
इस उदाहरन मे  name को input किया जाता है |  और loop मे name के प्रत्येक character को isupper() से check किया जाता है | अगर यूजर name में कोई भी character uppercase होता है तब All Character are uppercase. display होता है |

7.toupper()
इस function से ,lower case character को uppercase character को convert करने  के लिए किया जाता है |
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string name ,name1 ;
cout<<“Name : “;
cin>>name ;
int count =0;
int length = strlen(name);
for(int i =0;i<=length ; i++)
{
name1[i]=toupper(name[i]);
}
cout<<“Uppercase Name :”<<name1 <<endl;
getch();
}
इस उदाहरन मे  name को input किया जाता है |  और loop मे name के प्रत्येक character को isupper() से  convert करके name1 मे assign किया जाता है | उसके बाद name1 को display किया जाता है |

7.tolower ()
इस function से ,uppercase character को lowercase character को convert करने  के लिए किया जाता है |
इसका उदाहरन होगा
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
string name ,name1 ;
cout<<“Name : “;
cin>>name ;
int count =0;
int length = strlen(name);
for(int i =0;i<=length ; i++)
{
name1[i]=tolower(name[i]);
}
cout<<“lowercase Name :”<<name1 <<endl;
getch();
}
इस उदाहरन मे  name को input किया जाता है |  और loop मे name के प्रत्येक character को islower() से  convert करके name1 मे assign किया जाता है | उसके बाद name1 को display किया जाता है |

इस article मे , ctype class के सबसे ज्यादा use किये जाने वाले function को discuss किया जाता है | इस functions को use करके , प्रोग्रामर अपनी programming skills को improve किया जाता है |

Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

3 days ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

6 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

1 week ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now