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++ : Logical Operator in hindi , Equal than , Logical OR , AND , XOR Operators in c++ language

Logical OR , AND , XOR Operators in c++ language , C++ : Logical Operator in hindi , Equal than :-
इससे पहले एक article मे c++ मे उपस्थित सभी data type को discuss कर लिए है लेकिन केवल arithmetic operator or relational operator को discuss किया है | अब इस article मे  logical operator को discuss करेगे |Relation Operator
c++ मे operators को basically तीन प्रकार से divind किया जाता है :-
1. arithmatic operator
इस category मे पांच  arithmatic operators है जिसमे addition,substraction , multiplication , division, और modulas है | इस सभी operator को basic arithmatic operation मे use किया जाता है | इन सभी को हम पहले अच्छी तरह से discuss कर चुके है |
2. Relation operator
जब किसी प्रोग्राम मे दो या दो से अधिक values को compare किया जाता है तब इस operator को use किया जाता है | इस category मे पांच  Relation operator है | जब किसी expression मे Relation operator को use किया जाता है तब इसे Relation expression कहते है | सभी  Relation expression की value boolean होती है | अथात इसकी true और false value होती है | इसमें larger than , smaller than , larger and equal than और smaller and equal than होता है |

1. Equal than
इस operator का use किसी  दो values मे compare करने के लिए use किया जाता है | इसका syntax ‘==’ होता है | इसमें first == second statement से मतलब होता है first value का compare second value से होता है | अगर first value , second value से समान होती तब इस expression का आउटपुट ‘1’ होता है  अन्यथा ‘0’ होती है |
इसका उदाहरण होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
bool t;
cout<<“Enter First Value :”<<endl;
cin>>a;
cout<<“Enter Second Value :”<<endl;
cin>>b;
t=(a==b);
if(b=’TRUE’)
{
cout<<“Both values are same .” <<endl;
}
else
cout<<“Both values are not same . “<<endl;
getch();
}
इस उदाहरण मे दो variable को declare किया जाता है | जिसको variable ‘a’ और ‘b’ मे assign कर दिया जाता है |
और (a==b) expression के आउटपुट को variable  t मे assign कर देते है | इस variable का type boolean है |
अगर variable ‘t’ की value ‘1’ होती है तब Largest value :a print होगा |
अन्यथा  Largest value :  b display होता है |
इसका आउटपुट होगा
Enter First Value : 12
Enter Second Value : 23
Both values are not same.

2. Logical Or
जब किसी दो reletion sttement को एक साथ test किया जाता है | तब इस logical operator का use किया जाता है | इसका syntax “||” है | अगर दोनों reletion statement का आउटपुट true होता है  तब  इस expression का आउटपुट भी ‘1’ होगा |
इसका truth tabel होता है |
अगर input a = 1 or int b= 1 than output 1 होता है |
अगर input a = 1 or int b= 0 than output 0 होता है |
अगर input a = 0 or int b= 1 than output 0 होता है |
अगर input a = 0 or int b= 0 than output 0 होता है |
इसका उदाहरण होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
bool t;
cout<<“Enter First Value :”<<endl;
cin>>a;
cout<<“Enter Second Value :”<<endl;
cin>>b;
t=(a<b || a>b);
if(b=’TRUE’)
{
cout<<“Both values are same .” <<endl;
}
else
cout<<“Both values are not same . “<<endl;
getch();
}
इस उदाहरण मे दो variable को declare किया जाता है | जिसको variable ‘a’ और ‘b’ मे assign कर दिया जाता है |
और (a<b || a>b) expression के आउटपुट को variable  t मे assign कर देते है | इस variable का type boolean है |
अगर variable ‘t’ की value ‘1’ होती है तब Both values are same .print होगा |
अन्यथा  Both values are not same. display होता है |
इसका आउटपुट होगा
Enter First Value : 12
Enter Second Value : 23
Both values are not same .

2. Logical AND
जब किसी दो reletion sttement को एक साथ test किया जाता है | तब इस logical operator का use किया जाता है | इसका syntax “&&” है | अगर दोनों reletion statement का आउटपुट false होता है  तब  इस expression का आउटपुट भी ‘false’ होगा | अगसर कोई एक statement true होता है तब  expression का आउटपुट ‘1’ होगा |
इसका truth tabel होता है |
अगर input a = 1 or int b= 1 than output 1 होता है |
अगर input a = 1 or int b= 0 than output 1 होता है |
अगर input a = 0 or int b= 1 than output 1 होता है |
अगर input a = 0 or int b= 0 than output 0 होता है |
इसका उदाहरण होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c;
cout<<“Enter First Value :”<<endl;
cin>>a;
cout<<“Enter Second Value :”<<endl;
cin>>b;
cout<<“Enter Third Value :”<<endl;
cin>>c;
if (a>b && b>c )
{
cout<<“a is larger among than all three.”;
}
if (a>b && b>c )
{
cout<<“a is larger among than all three.”;
}
if (b>a && a>c )
{
cout<<“b is larger among than all three.”;
}
cout<<“c is larger among than all three.”;
getch();
}
इस उदाहरण मे दो variable को declare किया जाता है | जिसको variable ‘a’ और ‘b’ मे assign कर दिया जाता है |
और (a>b && b>c ) expression के आउटपुट true hota है | तब  a is larger among than all three. display होगा |
अगर b>a && a>c ) की value ‘1’ होती है तब b is larger among than all three. print होगा |
अन्यथा  c is larger among than all three. display होता है |
इसका आउटपुट होगा
Enter First Value : 12
Enter Second Value : 23
Enter Third Value : 32
c is larger among than all three.

4. Logical Xor
जब किसी दो reletion sttement को एक साथ test किया जाता है | तब इस logical operator का use किया जाता है | इसका syntax “~” है |  अगर कोई एक statement false होता है तब  expression का आउटपुट ‘false’ होगा | और अगर दोनों statement true और false होता है तब आउटपुट true होगा |
इसका truth tabel होता है |
अगर input a = 1 or int b= 1 than output 1 होता है |
अगर input a = 1 or int b= 0 than output 0 होता है |
अगर input a = 0 or int b= 1 than output 0 होता है |
अगर input a = 0 or int b= 0 than output 1 होता है |
इसका उदाहरण होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
cout<<“Enter First Value :”<<endl;
cin>>a;
cout<<“Enter Second Value :”<<endl;
cin>>b;
if (a==10 ~ b== 100)
{
cout<<“a or b is larger than 100 “;
}
else
{
cout<<“a or b is not larger than 100”;
}
getch();
}
इसका आउटपुट होगा
Enter First Value : 12
Enter Second Value : 23
a or b is not larger than 100

Sbistudy

Recent Posts

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

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

20 hours ago

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

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

3 days ago

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

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

5 days ago

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

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

5 days ago

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

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

5 days ago

FOURIER SERIES OF SAWTOOTH WAVE in hindi आरादंती तरंग की फूरिये श्रेणी क्या है चित्र सहित

आरादंती तरंग की फूरिये श्रेणी क्या है चित्र सहित FOURIER SERIES OF SAWTOOTH WAVE in…

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