rootblysub
전체 영상YouTube 자막 번역English

Print Array Elements in C++ | C++ Example Programs #79

0:00
Today we're going to talk about how we can take array elements from the user, and then how we can print the array elements.
आज हम बात करने वाले हैं कि हम यूजर से कίस तरह से आरे के अलीमिंट को ले सकते हैं, और उसके बाद आरे के अलीमिंट को किस तरह से प्रिन्ट करवा सकते हैं।
0:09
Along with that, we'll look at some basic concepts related to arrays. So, let's begin.
और इसी के साथ साथ हम देखेंगे एरे से इलेटिड कुछ basic concepts को तो आईए शुरू करते हैं
0:17
Assalamualaikum, friends. Welcome to Technical Ammar. So first of
Assalamualaikum friends, welcome to technical ammar So first of
0:20
all, let's see why we need to create an array and how we can use it.
all हम क्या करते हैं कि ये देख लेते हैं कि हमें एरे को बनाने की जरूरत क्यों परती है और हम एरे को किस तरह से use कर सकते हैं
0:28
After that, we'll see how to get array element input from the user and how to print those elements,
उसके बाद हम देखेंगे कि हम user से किस तरह से input ले सकते हैं, array क elements को, और किस तरह से हम उन elements को print करा सकते हैं,
0:37
so for example, here I create an int-type variable, a,
so for example, यहाँ पे मैं int type का एक variable बनाता हूँ, a,
0:42
If I need 5 variables here, what will I have to do here?
अगर यहाँ पे मुझे 5 variables की जरूरत पड़ेगी, तो मुझे क्या करना पड़ेगा, यहाँ पे,
0:58
For example, here I say, what will the names of my five variables be? A, B, C, D, and E.
example, यहाँ पर मैं कहता हूँ के मेरे जो पांच variables हैं, उनके name क्या होंगे? A, B, C, D, and E.
1:07
So I had five variables here, came up with their names, and declared them.
यहाँ पर तो मेरे पास पांच variable थे, उनके मैंने name भी सोच लिए, और उन्हें declare भी करा दिया.
1:13
For example, if we had 10 variables, 100 variables, or thousands of variables, what would we have to do?
For example, हमारे पास अगर यहाँ पे 10 variables होते, 100 variables होते, या 1000s variables होते हैं हमें क्या करना पड़ता है?
1:23
First, we'd have to think of their names, which
पहले उनके name सोचने पड़ते है, जो के
1:26
A Beut was very much where it could go; what do we have to do after that?
एक Beut ही बहुत ही जहाँ चाल सक था, उसके बाद हमें क्या करना
1:30
has to
पड़ता है,
1:32
This is also a difficult task. After that, what do we
यहां भी एक मुश्टल टास्क है । उसके बाद हमें क्या
1:35
have to do? We would write cn here and
करना पड़ेगा पड़ेगा कि यहां पे हम लिखेंगे cn और
1:38
write a, b, c here, so
यहां पे लिखेंगे a, b, c तो
1:42
This way, we'd have to do a lot of work, and our burden would increase. To reduce this difficulty, we'll use an array.
इस तरह से क्या होगा हमें बहुत सा काम करना पड़ेगा यहां पे हमारा जो है न बर्डन बढ़ जाएगा तो इसी difficulty को काम करने के लिए हम क्या करेंगे array का यूज़ करेंगे
1:53
How do we create an array? First of all, we'll think of a name for the array.
array بنانے کا طریقہ کیا ہے यहाँ पर, first of all हम array का नाम सोचेंगे
1:58
For example, my array is named A. After that, we'll put square brackets here.
for example, मेरे पास array का नाम है A, उसके बाद हम क्या करेंगे यहाँ पर लगाएंगे square brackets
2:05
Inside these brackets, we'll specify the array's size. For example, if I write 5 here, what happens?
इन brackets के अंदर हम क्या करेंगे array का size mention करेंगे for example, अगर यहाँ पर मैं लिखता हूँ 5, तो क्या होगा
2:18
If
अगर
2:23
I write ten here, then our
यहां पर लिखूंगा टैन तो हमारे
2:26
array will have ten variables, and
पास टैन variables वाला एक array बन जाएगा और
2:30
if I write 100 here, we'll have an array with 100 variables. This means we've created 100 variables here, so our
अगर यहां पर मैं लिकुंगा 100 तो यहां पर 100 variables वाला array बन जाएगा इसका मतलब क्या होगा कि हम ने यहां पर 100 variables बना लिये तो यहां पर हमारी
2:51
So what is an array? An array is a group of variables, but they must be of the same type.
So array हमारे पास क्या है? Array group of variables है But वो same type के होने चाहिए
2:58
Here, we created 100 variables of type int. If you want them to be of type float, write float here.
यहाँ पे हमने क्या किया? 100 variables बनाए जो के Int type के हैं अगर आप चाहते हैं के float type के हों तो आप यहाँ पे लिखेंगे float
3:07
And if you want them to be of type double, write double here. So what can we do?
और double type के हों तो आप यहाँ पे लिखेंगे double तो हम क्या कार सकते हैं?
3:12
We can group elements of the same type using an array.
same type के elements का एक group बना सकते हैं array की मदद से
3:17
So, whatever number I write here will be the array's
so यहां पे मैं जो भी number लिखूंगा वो array का
3:21
size. You can write 10
size होगा आप चाहें तो यहां पे 10
3:24
here too, which will create an array of 10 variables. If you write 20 here, it will create an array of 20 variables. So that solves our problem.
भी लेख सकते हैं तो 10 variables का एक array बनेगा और यहां पे अगर आप 20 लिखेंगे तो 20 variables का एक array बन जाएगा तो यह हमारी problem तो solve हुई
3:35
But now we'll run into another difficulty: if I want to access the 5th variable in this array, how do I do that?
बज़ यहां पे हमें एक मुश्किल यह देखने को मिलेगी कि अगर इस array में से मैं 5th variable को access करना चाता हूं तो वो मैं कैसे access करूंगा
3:45
So, if you want to access any individual variable in an array, what do you do?
तो अगर आप किसी भी individual variable को access करना चाते हैं array में से तो आप क्या करेंगे?
3:52
You use indexes. Let's see what indexes are in an array.
indexes का use करेंगे तो indexes array में क्या होते हैं यही देख लेते हैं
3:58
So, for example, I created an array here with 5 elements.
So for example मैंने यहां पे एक array बनाया जिसके अंदर 5 elements है
4:04
The first element here is 10, the second is 20, and the third is 30.
First element हमारे पास यहां पे 10, second है 20 and third है 30
4:09
The fourth is 40, and what is the fifth element here? 50.
Fourth हमारे पास है 40 and यहां पे fifth element हमारे पास क्या है 50
4:14
So, if I want to access this element, what do I do? I use indexes.
So अगर मैं चाहता हूँ कि इस element को यहां से access करूँ तो मैं क्या करूँगा indexes का use करूँगा
4:35
Indexing starts at 0 and ends at n-1.
इनकी indexing start होती है 0 से और end होती है यहां पर n-1 पे
4:42
How many elements did we have here? 5. So, what is the value of n? 5.
यहां पर हमारे पास elements कितने थे 5 तो n की value क्या होगी 5
4:48
N-1, that is, 4. So, here it starts at 0 and goes up to 4, that is, up to n-1.
N-1 यानिके 4 तो यहां पे हमारे पास 0 से स्टार्ट होगी और यह 4 तक जाएगी यानिके n-1 तक जाएगी
4:57
If I want to access this element, what do I need to do?
अगर मैं इस element को access करना चाहता हूं तो मुझे क्या करना पड़ेगा

처음 5분까지만 무료로 볼 수 있어요. 이어서 보려면 앱이나 확장 프로그램을 설치하세요.

다운로드
다른 언어로 요청하기
Chrome 확장 프로그램과 모바일 앱으로도 이용해보세요다운로드
번역 진행 중0%