JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Categories: C Language in hindi

Array -Two Dimension Array 2D in hindi in c computer language दो डायमेंशन अर्रे क्या है हिंदी में

दो डायमेंशन अर्रे क्या है हिंदी में Array -Two Dimension Array 2D in hindi in c computer language :-
Two dimension array : Two dimension array मे data values दो subscripts  मे store होती है |(i) row (ii) coloum |इसे array ओप्फ़ array भी कहते है |इसका  struture matrix की तरह होता है |इसे matrix array भी कहते है |Matrix मे , data को row और coloum मे यव्स्थित करते है |
इसका syntax है :
data type array name [row size][column size];
data type : ये define करता है की array मे किस तरह का data type store होगा |
array name : ये array का नाम होता है |
row size: ये number of row को define करता है |
column size: ये number of column को define करता है |
उदहारण के लिए:
int a[3][2];
इस statement से एक 3*2  two dimension array बनती है जिसका नाम a और data type int है |इसमें 3 row और 2 column होती है |
Two dimension array, one dimension array की array होती है |सभी one dimension array का address / index 0 से start होता है |और  two dimension array मे , index two डिजिट का होता है एक row (one dimension array) के index की value होती है |दूसरा column array(one dimension array)का index होता है |

 

Initializing of Two Dimension Array :
जैसे one dimension array को सीधे initial कर सक्लते है उसी प्रकार two dimension array को भी सीधे initial कर सकते है |
इसका syntax है |
data type array name[row size][column size] = { datas };
इस syntax datas मे row और column के सभी values लिखी जाती है |उदहारण के लिएय :-
int a[2][3]={1,2,3,4,5,6};
इस उदहारण मे , 1,2,3 पहले row के index ‘0’ के column 0, column 1,column 2 मे store होगा |और 4,5,6 दुसरे row के index ‘1’ के column 0, column 1,column 2 मे store होगा|
इसके अलावा ,प्रोग्रामर  नीचे दिए गए syntax से भी two dimension array को initial कर सकता है |
data type array name[row size][column size] = { {row 1 datas}
                                                                             {row 2 datas}
                                                                             {……………….}
                                                                             {……………….}
                                                                             {row n datas }  };
इसमें reader array values को सरलता से read कर सकता है |
इसके अलावा ,two dimension array को run time पर initial कर सकते है |इसमें looping का use होता है |
जब values की संख्या बहुत ज्यादा होती है जब इस methodology use करते है|
उदाहरण के लिए :
#include<stdio.h.
#include<conio.h>
void main()
{
int a[3][4];
printf(“Enter Array data\n”);
for(i=0;i<3;i++)
{
for(j=2;j<4;j++)
{
scanf(“%d”,&a[i][j]);
}
}
for(i=0;i<3;i++)
{
for(j=0;j<4;j++)
{
printf(“%d”,a[i][j]);
}
printf(“\n”);
}
}
getch();
}
ये उदहारण 3*4 की  matrix print करना का है| जिसमे दो for loop से data को array के index मे store कराया गया है |और फिर दो for loops से data को write किया गया है |
आउटपुट होगा :
Enter Array data
12 23 27 54 65 54 23 34 36 78 79 23
12 23 27 54
65 54 23 34
36 78 79 23
उदहारण -2 :
/ Program for add two matrix*/
#include<stdio.h.
#include<conio.h>
void main()
{
int a[3][4];
int b[3][4];
printf(“Enter First Array data\n”);
for(i=0;i<3;i++)
{
for(j=2;j<4;j++)
{
scanf(“%d”,&a[i][j]);
}
}
printf(“\nEnter Second Array data\n”)
for(i=0;i<3;i++)
{
for(j=2;j<4;j++)
{
scanf(“%d”,&b[i][j]);
}
}
for(i=0;i<3;i++)
{
for(j=0;j<4;j++)
{
c[i][j]=a[i][j]++b[i][j];
}
}
printf(“\n Addition of two matrix \n”);
for(i=0;i<3;i++)
{
for(j=0;j<4;j++)
{
printf(“%d”,c[i][j]);
}
printf(“\n”);
}
getch();
इस प्रोग्राम मे चार for loops run हो रहे है:-
(i) Matrix ‘a’ के data को read करने के लिए |
(ii)Matrix ‘b’ के data को read करने के लिए |
(iii) Addition operation perform करने के लिए |
(iv) Output Matrix को print करने के लिए |
आउटपुट होगा :
Enter First Array data
12 23 43 43 47 76 54 58 32 34 21 12
Enter Second Array data
13 24 44 45 49 80 69 52 45 14 13 17
Addition of two matrix
15    47      87     88
96    156    123   110
77    48      34     29
Memory Representation :
Two dimension array continuous memory location मे store होती है| ये दो तरह के हो सकती है |
1.Row major:
इसमें datas, row wise store होती है | इसमें row 1 के datas पहले n locations पर store होती है |और row 2 के data उसके बाद store होते है |
2.Column Major:
इसमें datas, column wise store होती है | इसमें column 1 के datas पहले n locations पर store होती है |और column 2 के data उसके बाद store होते है |
Sbistudy

Recent Posts

सती रासो किसकी रचना है , sati raso ke rachnakar kaun hai in hindi , सती रासो के लेखक कौन है

सती रासो के लेखक कौन है सती रासो किसकी रचना है , sati raso ke…

21 hours ago

मारवाड़ रा परगना री विगत किसकी रचना है , marwar ra pargana ri vigat ke lekhak kaun the

marwar ra pargana ri vigat ke lekhak kaun the मारवाड़ रा परगना री विगत किसकी…

21 hours 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
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