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++ : Array Types in hindi , how many types of array in c++ language with example programs

how many types of array in c++ language with example programs , C++ : Array Types in hindi :-
इससे पहले के article मे array को discuss किया है | लेकिन one dimensional array को discuss किया है | अब इस article मे array के type को discuss करते है |
Array
array समान data type के समूह होता है | इसके लिए निन्म syntax को fellow किया जाता है | int a[size]; यहा पर a array का नाम होता है और size array के element की number होती है | int integer data type है जो की array के द्वार hold की गयी value के type को define करता है | इसका उदाहरन होता है :
#include<iostream.h>
#include<conio.h>
void main()
{
int a[5];
cout<<“Enter Array Data :”<<endl;
for(i=0;i<5;i++)
{
cin>>a[i];
}
cout<<“Array Element”<<endl;
for(i=0;i<5;i++)
{
cout<<a[i];
}
getch();
}
इस उदाहरण मे array के element को read और display किया जाता है |
जब  i = 0 होगा तब array के first element को display किया जाता है |
जब i=1 होगा तब array के second element को display किया जाता है |
जब  i = 2 होगा तब array के  third element को display किया जाता है |
जब i=3 होगा तब array के fourth element को display किया जाता है |
जब  i = 4 होगा तब array के fifth  element को display किया जाता है |
इसका आउटपुट होता है :-
Enter Array Data : 12 23 43 23 12
Array Element
12 23 43 23 12Array का types
1. one dimension array
जब किसी array मे केवल एक subscript होता है | इसका मतलब है इसमें केवल एक row होती है जिसमे data को arrange किया जाता है  | उपर दिए गये उदाहरन में use की गयी array one dimensional array को use किया गया है | जिसमे data को केवल एक row मे arrange किया गया है  |

2. Two dimension array
जब किसी array मे दो subscirpt होते है तब two dimensional array कहते है | इसमें एक subscirpt row हटा है और दूसरा subscirpt colunm को define किया जाता है | इसका syntax होता है :
int array_name [row_size][colunm_size];
यहा पर
array_name: ये array का नाम है जिसका use प्रोग्राम मे array को use करने एक लिए किया जाता है |
row_size: ये row की size को define किया जाता है |
colunm_size : ये colunm size को define किया जाता है |
int : ये  array के value के data type integer define किया जाता है  |
इसका उदाहरन होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a[3[3];
cout<<“Enter Array Data :”<<endl;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cin>>a[i][j];
}
}
cout<<“Matrix Form”<<endl;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<a[i][j];
}
cout<<endl;
}
getch();
}
इस उदहारण मे Two dimension array  को use किया गया है | जिसमे row और colunm की size ‘3’ है | अथात id array मे तीन row और colunm होती है | पहले loop मे array की element को read किया जाता है |
जब i=0 और j=0 होगा तब matrix array के ( 0,0 ) पर first element को insert किया जाता है |
जब i=0 और j=1 होगा तब matrix array के ( 0,1 ) पर second element को insert किया जाता है |
जब i=0 और j=2 होगा तब matrix array के ( 0,2 ) पर third element को insert किया जाता है |
जब i=1 और j=0 होगा तब matrix array के ( 1,0 ) पर fourth element को insert किया जाता है |
जब i=1 और j=1 होगा तब matrix array के ( 1,1 ) पर fifth  element को insert किया जाता है |
जब i=1 और j=2 होगा तब matrix array के ( 1,2 ) पर sixth element को insert किया जाता है |
जब i=2 और j=0 होगा तब matrix array के ( 2,0 ) पर  seventh element को insert किया जाता है |
जब i=2 और j=1 होगा तब matrix array के ( 2,1 ) पर eight element को insert किया जाता है |
जब i=2 और j=2 होगा तब matrix array के ( 0,0 ) पर nineth element को insert किया जाता है |

इसका आउटपुट होगा :
Enter Array Data : 12 23 14 34 5 67 54 52 67
Matrix Form
12  23  14
34  05  67
54  52  67

3. Multi dimension array
जब किसी array मे दो या दो से अधिक subscirpt होते है तब  multi dimensional array कहते है | इसमें एक subscirpt row होता  है और दूसरा subscirpt colunm  और तीसरा  subscript को define किया जाता है | इसका syntax होता है :
int array_name [subscipt_size1][subscipt_size2][subscipt_size3];
यहा पर
array_name: ये array का नाम है जिसका use प्रोग्राम मे array को use करने एक लिए किया जाता है |
subscipt_size1: ये  subscript1 की size को define किया जाता है |
subscipt_size2 : ये subscript2 की  size को define किया जाता है |
subscipt_size3 : ये subscript3 की  size को define किया जाता है |
int : ये  array के value के data type integer define किया जाता है  |
इसका उदाहरन होता है :-
#include<iostream.h>
#include<conio.h>
void main()
{
int a[3[3][3];
cout<<“Enter Array Data :”<<endl;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
{
cin>>a[i][j][k];
}
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
{
cout<<a[i][j][k];
}
cout<endl;
}
cout<<endl;
}
getch();
}
इस उदहारण मे Two dimension array  को use किया गया है | जिसमे row और colunm की size ‘3’ है | अथात id array मे तीन row और colunm होती है | पहले loop मे array की element को read किया जाता है |
जब i=0 और j=0 और k=0 होगा तब matrix array के ( 0,0,0 ) पर first element को insert किया जाता है |
जब i=0 और j=0 और k=1 होगा तब matrix array के ( 0,0,1 ) पर second element को insert किया जाता है |
जब i=0 और j=0 और k=2 होगा तब matrix array के ( 0,0,2 ) पर third element को insert किया जाता है |
जब i=1 और j=1 और k=0 होगा तब matrix array के ( 1,1,0) पर fourth element को insert किया जाता है |
जब i=1 और j=1 और k=1 होगा तब matrix array के ( 1,1,1 ) पर fifth  element को insert किया जाता है |
जब i=1 और j=1 और k=2 होगा तब matrix array के ( 1,1,2 ) पर sixth element को insert किया जाता है |
ये तब तक चलता रहेगा जब तक i ,j और k की value ‘2’ नहीं हो जाती है |

इस article array के तेनो type को discuss किया गया है  |

Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

9 hours ago

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

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

3 days ago

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

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

5 days ago

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

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

1 week ago

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

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

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