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++ : Special Operators in hindi , what are Special Operator in c++ language with programs examples

what are Special Operator in c++ language with programs examples , C++ : Special Operators in hindi :-
इससे पहले के article मे , increment , decrement और sizeof() operator को discuss किया है | अन इस article मे कुछ और  विशेष operators को discuss करेगे | जिससे आपके programming skills बढ़ेगी  |
1. Comma operator
comma operator का use c++ language मे दो प्रकार से use किया जा सकता है  | इसका syntax है :-
‘,’ ;
यहा पर comma operator को प्रकार को निन्म प्रकार से use किया जाता है :-
1. As operator
जब comma operator को operator की तरह use किया जाता है तब ये binary operator की तरह use किया जाता है | इसमें पहले operand को दुसरे operand से अलग करने के लिए comma operator को use किया जाता है | इसके लिए निन्म उदाहरन है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a={3,6};
cout<<“value of a:”<<a;
}
getch();
}
इस उदाहरण मे , a मे 3 की value assign की जाती है और बाद मे comma operator से a मे ‘6’ की value assign की जाती है  | इसका आउटपुट होगा :
value of a : 6
2. As Separator
comma operator को separator की तरह भी use किया जा सकता है | comma operator को निन्म तरह से seperator की तरह use किया जा सकता है :-
1.function मे argument को seperate करने के लिए |
2.variable declare करने के लिए |
3.Enum की value को define करने के लिए |
4.macro को define करने के लिए किया जाता है |
इसके लिए निन्म उदाहरन मे सभी topic को discuss किया है :-
#include<iostream.h>
#include<conio.h>
int add(int , int );
void main()
{
int a,b,c;
cout<<“Enter a :”<<endl;
cin>>a;
cout<<“Enter b : “<<endl;
cin>>b;
c= add(a,b);
cout<<“value of c:”<<c;
}
getch();
}
int add (int e,int f )
{
int sum ;
sum =e+f;
return (sum ) ;
}
इस उदाहरण मे
int a,b,c; – तीन variable a,b और  c को देच्क्स्लारे करने के लिए comma operator को use किया जाता है |
c= add(a,b); – इसमें function को call किया जाता है | इसमें pass argument a,b को comma operator से separate किया जाता है |
इसका आउटपुट होगा :
Enter a : 12
Enter b : 13
value of c: 25
Condition Operator
condition operator c++ language मे एक मात्र tinary operator है | अतः इसमें तीन operand को use किया जाता है | इसके syntax होता है :-
(condition)? true_statement ; false_statement ;
यहा पर
condition : ये condition को check किया जाता है | अगर condition true होती है तब true_statement perform होता है | अन्यथा condition false होती है |
true_statement : ये true statement होता है जो की condition को true होने पर return होती है |
false_statement : ये false_statement होता है जो की condition के false होने पर return होती है |
इसका उदाहरन होता है :-
#include<iostream.h>
#include<conio.h>
int compare (int , int );
void main()
{
int a,b,c;
cout<<“Enter a :”<<endl;
cin>>a;
cout<<“Enter b : “<<endl;
cin>>b;
c= compare (a,b);
cout<<“Smaller value :”<<c;
}
getch();
}
int compare (int e,int f )
{
return ((e<f):e:f;) ;
}
इस उदाहरन मे , दो value के बीच compare किया जाता है | इसमें यूजर define function को use किया जाता है | इसमें condition operator को use किया जाता है |
जब a<b की condition को true होती है तब ‘a’ return होती है |
और a<b की condition false होती है तब ‘b’ return होती है |
इसका आउटपुट होता है :-
Enter a : 16
Enter b : 13
Smaller value : 13
Address Operator
इससे पहले के article मे pointer variable को use किया जाता है जो की किसी दुसरे variable के address को hold करता है | और pointer variable की value किसी variable के address को define करता है | लेकिन c/c++ language मे address operator होता है जो की किसी भी variable के address को define करता है |इसका syntax होता है :-
&variable name ;
यहा पर variable name variable का नाम है जिसका address को calculate किया जाता है |
इसका उदाहरन होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a;
char c;
double b;
float f;
cout<<“Enter Integer Value :”<<endl;
cin>>a;
cout<<“Enter Character Value :”<<endl;
cin>>c;
cout<<“Enter Flaot Value :”<<endl;
cin>>f;
cout<<“Enter Double Value :”<<endl;
cin>>d;
cout<<“Value of a: “<<a<<“And Address of a :”<<&a<<endl;
cout<<“Value of b: “<<b<<“And Address of b :”<<&b<<endl;
cout<<“Value of c: “<<c<<“And Address of c :”<<&c<<endl;
cout<<“Value of f: “<<d<<“And Address of f :”<<&f<<endl;
getch();
}
इसका आउटपुट होगा :-
Enter Integer Value : 15
Enter Character Value : f
Enter Float Value : 16.23
Enter Double Value : 15.200
Value of a: 15 And Address of a : 4000
Value of b: 15.200 And Address of b : 4008
Value of c: f And Address of c : 4010
Value of f: 16.23 And Address of f : 4018
Sbistudy

Recent Posts

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

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

3 days ago

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

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

4 days ago

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

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

7 days ago

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

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

7 days ago

elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है

दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…

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