हिंदी माध्यम नोट्स
Categories: c++ language in hindi
C++ : Arithmetic Operator in hindi , what are and types of Arithmetic Operator Modulus in c++ language programe
what are and types of Arithmetic Operator in c++ language programe , C++ : Arithmetic Operator in hindi :-
इससे पहले के article मे , हमने data type( integer , float , character आदि ) को discuss किया है अब इस article मे हम इन data type पर perform होने वाले Arithmetic operation को discuss करेगे |
Operation
किसी भी programming language मे दो प्रकार के task perform होता है :-
1. logical : जिसमे किसी लॉजिक को perform किया जाता है जैसे दो value मे से बड़ी value को identify करना | या किसी statement का सही या गलत होना |
2. Arithmetic : इसमें mathematics operation perform होते है | जैसे किसी दो value के बीच addition , multiplication आदि |
दोनों ही operation के लिए दो पत्रकार की information होनी चाहिए :-
1.Operand: इन पर operation perform होता है |
2.Operator : ये operation को define करते है |
उदाहरण के लिए :
#include<iostram.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“Enter First Value : “<<endl;
cin>>a;
cout<<“Enter Second Value : “<<endl;
cin>>b;
c=a+b;
cout<<“Addition of values : “<<c<<endl;
getch();
}
इस उदाहरन मे तीन इन्तेग्र type variable ‘a’,’b’, और ‘c’ को define किया गया है | और statement c=a+b ; मे addition operation perform हो रहा है | इस statement मे ‘a’ और ‘b’ दो operand है जिस पर addition operation perform हो रहा है |
इसका आउटपुट होगा :
Enter First Value : 23
Enter Second Value : 12
Addition of values : 35
Arithmetic Operator
इस category मे mathematics के पांच basic operation को include किया गया है | in basic operation से बड़े से बड़े expression को बनाया जाता है | in operation के लिए पांच operators को भी include किया गया है |operation निन्म होते है :
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Modulus
ये सभी पांच operation के लिए दो operands के जरुरत होती है | operand और operator मिल कर जो statement बनाते है उसे expression कहते है |
1.Addition
Addition operation का use किसी दो या दो से अधिक values को जोड़ने के लिए किया जाता है | इसका keyword ‘+’ होता है | इसके expression को addition expression भी कहते है | अतः operands या तो operands या direct values हो सकती है |
उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“Enter First Value : “<<endl;
cin>>a;
cout<<“Enter Second Value : “<<endl;
cin>>b;
c=a+b;
cout<<“Output of First Addition : “<<c<<endl;
int d= 45+889;
cout<<“Output of second Addition : “<<d<<endl;
getch();
}
इस उदाहरण मे दो addition expressions है|
c=a+b; : इस statement मे , operands , variable है | यूजर द्वारा input की गयी values को in variable मे assign किया गया है |और इन variables की value का addition होता है |
d= 45+889 : इस statement मे direct values को operand की तरह use किया है |
इसका आउटपुट होगा :
Enter First Value : 234
Enter Second Value : 123
Output of First Addition : 357
Output of second Addition : 934
2.Subtraction
Subtraction operation का use किसी दो या दो से अधिक values को घटाने के लिए किया जाता है | इसका keyword ‘-‘ होता है | इसके expression को Subtraction expression भी कहते है | अतः operands या तो operands या direct values हो सकती है |
उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“First Value : “<<endl;
cin>>a;
cout<<“Second Value : “<<endl;
cin>>b;
c=a-b;
cout<<“Output of First Subtraction : “<<c<<endl;
int d= 45-22 ;
cout<<“Output of second Subtraction : “<<d<<endl;
getch();
}
इस उदाहरण मे दो addition expressions है|
c=a-b; : इस statement मे , operands variable है | इन variables की value का addition होता है |
int d= 45-22 : इस statement मे direct values को operand की तरह use किया है | अतः 45-22 का output display होगा |
इसका आउटपुट होगा :
First Value : 234
Second Value : 123
Output of First Subtraction : 111
Output of second Subtraction : 23
3.Multiplication
Multiplication operation का use किसी दो या दो से अधिक values को गुना करने के लिए किया जाता है | इसका keyword ‘*’ होता है | इसके expression को Multiplication expression भी कहते है | अतः operands या तो operands या direct values हो सकती है |
उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“Value 1 : “<<endl;
cin>>a;
cout<<“Value 2 : “<<endl;
cin>>b;
c=a*b;
cout<<“Output of First Multiplication : “<<c<<endl;
int d= 23*5 ;
cout<<“Output of second Multiplication : “<<d<<endl;
getch();
}
इस उदाहरण मे दो Multiplication expressions है|
c=a*b; : इस statement मे , operands variable है | इसमें variables की value का Multiplication होता है |
int d= 23*5 ; : इस statement मे direct values को operand की तरह use किया है | अतः 23*5 का output display होगा |
इसका आउटपुट होगा :
Value 1 : 2
Value 2 : 12
Output of First Multiplication : 24
Output of second Multiplication : 115
4.Division
Division operation का use किसी दो values मे भाग करने के लिए किया जाता है | इस operation मे , division के बाद quotient को display करता है | इसका keyword ‘/’ होता है | इसके expression को Division expression भी कहते है | अतः operands या तो operands या direct values हो सकती है |
उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“Value 1 : “<<endl;
cin>>a;
cout<<“Value 2 : “<<endl;
cin>>b;
c=a/b;
cout<<“Output of First Division : “<<c<<endl;
int d= 23 / 5 ;
cout<<“Output of second Division : “<<d<<endl;
getch();
}
इस उदाहरण मे दो Division expressions है|
c=a/ b; : इस statement मे , operands variable है | इसमें variables की value का Division होता है |
int d= 23 / 5 ; : इस statement मे direct values को operand की तरह use किया है | अतः 23 / 5 का quotient , output मे display होगा |
इसका आउटपुट होगा :
Value 1 : 12
Value 2 : 2
Output of First Division : 6
Output of second Division : 4
5.Modulus
Modulus operation का use किसी दो values मे भाग करने के लिए किया जाता है | इस operation मे , division के बाद remainder को display करता है | इसका keyword ‘%’ होता है | इसके expression को Division expression भी कहते है | अतः operands या तो operands या direct values हो सकती है |
उदाहरण के लिए :
#include<iostream.h>
#include<conio.h>
void main()
{
using namesapce std;
int a,b,c;
cout<<“Value 1 : “<<endl;
cin>>a;
cout<<“Value 2 : “<<endl;
cin>>b;
c=a%b;
cout<<“Remainder of First Division : “<<c<<endl;
int d= 23 % 5 ;
cout<<“Remainder of second Division : “<<d<<endl;
getch();
}
इस उदाहरण मे दो Division expressions है|
c=a % b; : इस statement मे , operands variable है | इसमें variables की value का Division होता है और इसके remainder को variable ‘c’ मे assign किया जाता है |
int d= 23 % 5 ; : इस statement मे direct values को operand की तरह use किया है | अतः 23 % 5 का remainder , output मे display होगा |
इसका आउटपुट होगा :
Value 1 : 12
Value 2 : 2
Remainder of First Division : 0
Remainder of second Division : 3
Remainder of second Division : 3
Recent Posts
मालकाना का युद्ध malkhana ka yudh kab hua tha in hindi
malkhana ka yudh kab hua tha in hindi मालकाना का युद्ध ? मालकाना के युद्ध…
4 weeks ago
कान्हड़देव तथा अलाउद्दीन खिलजी के संबंधों पर प्रकाश डालिए
राणा रतन सिंह चित्तौड़ ( 1302 ई. - 1303 ) राजस्थान के इतिहास में गुहिलवंशी…
4 weeks ago
हम्मीर देव चौहान का इतिहास क्या है ? hammir dev chauhan history in hindi explained
hammir dev chauhan history in hindi explained हम्मीर देव चौहान का इतिहास क्या है ?…
4 weeks ago
तराइन का प्रथम युद्ध कब और किसके बीच हुआ द्वितीय युद्ध Tarain battle in hindi first and second
Tarain battle in hindi first and second तराइन का प्रथम युद्ध कब और किसके बीच…
4 weeks ago
चौहानों की उत्पत्ति कैसे हुई थी ? chahamana dynasty ki utpatti kahan se hui in hindi
chahamana dynasty ki utpatti kahan se hui in hindi चौहानों की उत्पत्ति कैसे हुई थी…
1 month ago
भारत पर पहला तुर्क आक्रमण किसने किया कब हुआ first turk invaders who attacked india in hindi
first turk invaders who attacked india in hindi भारत पर पहला तुर्क आक्रमण किसने किया…
1 month ago