हिंदी माध्यम नोट्स
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
सती रासो किसकी रचना है , sati raso ke rachnakar kaun hai in hindi , सती रासो के लेखक कौन है
सती रासो के लेखक कौन है सती रासो किसकी रचना है , sati raso ke…
1 day ago
मारवाड़ रा परगना री विगत किसकी रचना है , marwar ra pargana ri vigat ke lekhak kaun the
marwar ra pargana ri vigat ke lekhak kaun the मारवाड़ रा परगना री विगत किसकी…
1 day ago
राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए sources of rajasthan history in hindi
sources of rajasthan history in hindi राजस्थान के इतिहास के पुरातात्विक स्रोतों की विवेचना कीजिए…
3 days ago
गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है ? gurjaratra pradesh in rajasthan in hindi
gurjaratra pradesh in rajasthan in hindi गुर्जरात्रा प्रदेश राजस्थान कौनसा है , किसे कहते है…
3 days ago
Weston Standard Cell in hindi वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन
वेस्टन मानक सेल क्या है इससे सेल विभव (वि.वा.बल) का मापन Weston Standard Cell in…
3 months ago
polity notes pdf in hindi for upsc prelims and mains exam , SSC , RAS political science hindi medium handwritten
get all types and chapters polity notes pdf in hindi for upsc , SSC ,…
3 months ago