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++ : Pointer Arithmetic Operation in hindi , what is Pointer Arithmetic Operations program in c++ language

what is Pointer Arithmetic Operations program in c++ language , C++ : Pointer Arithmetic Operation in hindi :-
इससे पहले के article मे , pointer , new और delete command को discuss किया है अब इस  article मे  pointer addition  और pointer airthmatic को discuss करेगे |
pointer एक एस variable होता है जिसमे किसी variable के address को store किया जाता है | Pointer variable से addition,subtraction और multiplication के प्रोग्राम को discuss करेगे |
C++ मे चार operation मुख्य है :
Addition
subtraction
multiplication
Division
Addition
इस operation मे टो pointer variables की value को  add किया जाता है | इसमें  दो pointer variable की value को add करने के लिए ‘+’ operator का use किया
जाता है | इसमें दो pointer variable को declare करते है | इस variable को ‘+’ के दोनों तरह लिख देते है इसके output को तीरसे variable मे assign कर देते है | इसका उदाहरण  है  :-
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std;
int *a,b;
int e,f;
cout<<“Enter First Value:”;
cin>>e;
cout<<“Enter Second Value : “;
cin>>f;
a=&e;
b=&f;
int o= *a+*b;
cout<<“Addition of values : “<< o;
getch();
}
इस addition मे दो pointer variable ‘a’ और ‘b’ है जिसमे variable ‘e’ और ‘f’ के address को assign किया जाता है | और o= *a+*b से pointer variable के address पर स्थित values को add किया जाता है | इसका आउटपुट होगा :
Enter First Value : 12
Enter Second Value : 23
Addition of values : 35
इस उदाहरण मे , o= *a+*b confusion create कर देते है |इस confusion को solve करने के लिए निन्म  statement को भी use कर सकते है :
o= (*a)+(*b);
इस method को  सबसे ज्यादा use किया जाता है क्योकि इसमें  + और *b के बीच () है जो की operator precedding से ststement को solve करने आसानी होती है |
Subtraction
इस operation मे टो pointer variables की value को  subtraction किया जाता है | इसमें  दो pointer variable की value को घटाने  के लिए ‘-‘ operator का use किया जाता है | इसमें दो pointer variable को declare करते है | इस variable को ‘-‘ के दोनों तरह लिख देते है इसके output को तीरसे variable मे assign कर देते है | इसका उदाहरण  है  :-
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std;
int *a,b;
int e,f;
cout<<“Enter First Value:”;
cin>>e;
cout<<“Enter Second Value : “;
cin>>f;
a=&e;
b=&f;
int o = (*a) – (*b);
cout<<“Subtraction of values : “<< o;
getch();
}
इस addition मे दो pointer variable ‘a’ और ‘b’ है जिसमे variable ‘e’ और ‘f’ के address को assign किया जाता है | और o= *a+*b से pointer variable के address पर स्थित values को घटाया  जाता है | इसका आउटपुट होगा :
Enter First Value : 24
Enter Second Value : 23
Addition of values : 1
इस उदाहरण मे , o= *a+*b confusion create कर देते है | इस confusion को solve करने के लिए o= (*a)-(*b);ststement को भी use कर सकते है |
Multiplication
इस operation मे दो या दो से अधिक  pointer variables की value को  multiply किया जाता है | इसमें  दो  pointer variable की value को गुणा  के लिए ‘*’ operator का use किया जाता है | इसमें दो pointer variable को declare करते है | इस variable को ‘*’ के दोनों तरह लिख देते है इसके output को तीरसे variable मे assign कर देते है | इसका उदाहरण  है  :-
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std;
int *a,*b,*c;
int e,f,h;
cout<<“First Value:”;
cin>>e;
cout<<“Second Value : “;
cin>>f;
cout<<“Third Value : “;
cin>>h;
a=&e;
b=&f;
c=&h;
int o = (*a) * (*b) *(*c);
cout<<“Multiply of values : “<< o;
getch();
}
इस addition मे दो pointer variable ‘a’,’b’ or ‘c’ है जिसमे variable ‘e’,’f’ or ‘h’ के address को assign किया जाता है | और o = (*a) * (*b) *(*c)  से pointer variable के address पर स्थित values को गुणा किया जाता है | इसका आउटपुट होगा :
First Value : 4
Second Value : 2
Third Value : 3
Multiply of values : 24
इस उदाहरण मे , o= *a**b**c ; को प्रोग्रामर द्वारा read करना मुश्किल होता  है | इस confusion को solve करने के लिए  o = (*a) * (*b) *(*c) statement को भी use कर सकते है |
Division
इस operation मे दो pointer variables की value को  भाग दिया जाता है | इसमें  दो  pointer variable की value को भाग  देने   के लिए ‘/’ operator का use किया जाता है | इसमें दो pointer variable को declare करते है | इस variable को ‘/’ के दोनों तरह लिख देते है इसके Qucent को तीरसे variable मे assign कर देते है |  दूसरी variable की value को पहली variable के value मे भाग  दिया जाता है | इसका उदाहरण  है  :-
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std;
int *a,*b,*c;
int e,f,h;
cout<<“First Value:”;
cin>>e;
cout<<“Second Value : “;
cin>>f;
a=&e;
b=&f;
int o = (*a) / (*b);
cout<<” Qucent of values : “<< o;
getch();
}
इस addition मे दो pointer variable ‘a’,’b’ है जिसमे variable ‘e’,’f’ के address को assign किया जाता है | और o = (*a)/(*b)  से pointer variable के address पर स्थित values को भाग  किया जाता है | इसका आउटपुट होगा :
First Value : 4
Second Value : 2
Qucent of values : 2
इस उदाहरण मे , o= *a/*b ; को प्रोग्रामर द्वारा read करना मुश्किल होता  है | इस confusion को solve करने के लिए  o = (*a) / (*b) statement को भी use कर सकते है |
Division
इस operation मे दो pointer variables की value को  भाग दिया जाता है | इसमें  दो  pointer variable की value को भाग  देने   के लिए ‘%’ operator का use किया जाता है | इसमें दो pointer variable को declare करते है | इस variable को ‘%’ के दोनों तरह लिख देते है इसके remainder को तीरसे variable मे assign कर देते है |  दूसरी variable की value को पहली variable के value मे भाग  दिया जाता है | इसका उदाहरण  है  :-
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std;
int *a,*b,*c;
int e,f,h;
cout<<“First Value:”;
cin>>e;
cout<<“Second Value : “;
cin>>f;
a=&e;
b=&f;
int o = (*a) % (*b);
cout<<” Qucent of values : “<< o;
getch();
}
इस addition मे दो pointer variable ‘a’,’b’ है जिसमे variable ‘e’,’f’ के address को assign किया जाता है | और o = (*a)%(*b)  से pointer variable के address पर स्थित values को भाग  किया जाता है | और इस भाग का remainder को display करवाता है | इसका आउटपुट होगा :
First Value : 4
Second Value : 2
Qucent of values : 0
इस उदाहरण मे , o= *a%*b ; को प्रोग्रामर द्वारा read करना मुश्किल होता  है | इस confusion को solve करने के लिए  o = (*a)%(*b) statement को भी use कर सकते है |
इस article मे pointer variable से  basic arithmetic operation के प्रोग्राम को discuss किया है अब आगे के article मे pointer variable से string data type को create और access करने के प्रोसेस को discuss करेगे |
Sbistudy

Recent Posts

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

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

22 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