🚀 Loved the tutorial? Take it further with Programiz PRO! Refine your skills, conquer coding fears, and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master C today! 👉Start Here: bit.ly/c-master
actually the answer is 0 and not random value...random value is generated when extra spaces are available and youre trying to print them....eg...youre given 5 index space to the array and only 2 are filled...then if u try to access the 4th index...u get random value...in this case it is different...
10:17 The code you've provided has an issue when trying to initialize a 2D array a[1][4]. You are trying to assign two rows of data, but the array you've declared can only hold one row with four elements, as specified by a[1][4].
Q. Which value will we get when we print arr[1][4] from the following array? int arr[1][4] = { {3, 6, 9, 12}, {2, 4, 6, 8} }; A.12 B. 8 C. 0 D. Random Value
in the above array the size is exceeded because the actual size is arr[1][3] so the the above array pics the value zero because if the array[1][4] has no value to pick by default it will pick zero
The correct answer is D. The array was initialized as "arr[1][4]" which is incorrect, it should be "arr[2][4]". This causes only the first array to be recognized by the program, so when we try to print "arr[1][4]" (which should be "arr[2][4]" if the array was initialized properly) the value does not exist, therefore a random value will be printed.
At first i thouhght the answer was B(8), I then realised that int arr [1][4] is not present in the array elements we have been provided with. [1][4] in this case means that there's only one array with 4 elements in the array . However the numbers displayed {3, 6, 9, 12} , {2, 4, 6, 8} represents two arrays with each having 4 elements, hence the proper representations should be int arr[2][4] = {3, 6, 9, 12} , {2, 4, 6, 8} . hence for the quiz provided you will get 0 example #include int main(){ int arr[2][4] = {{3, 6, 9, 12} , {2, 4, 6, 8}}; //two arrays with 4 elements in each array// printf("%d ",arr[1][3]); // [0 1 - one is second i.e second array], [0 1 2 3 - 3 is fourth] hence the command asks us to print the fouth element of the second array// return 0; } The output is 8
@@canhtranhLuat the answer is zero mate. Am sure you didn't read the whole comment..i said at first i thought the answer was 8, but after working it out..i.realized it's 0
For the quiz, the answer would be C since in the declaration of the multidimensional array, you only put that you have 1 array instead of arr[2][4]. Therefore, the entire second array doesn’t exist, and would print out a 0.
C is wrong it is a random value. This is because you only get zero when the index of an element was not given in an array that has the capacity of having that particular index.
@@kene583 I was going to say... Just because the other array doesn't exist doesn't mean anything, the fact is there is no 4 index in the first array and from the previous explanations any value that is accessed that doesn't exist in the array (the fourth index) prints out a random number.
//Which value will we get when we print arr[1][4] from the following array? int arr[1][4] = { {3, 6, 9, 12}, {2, 4, 6, 8} } #include int main() { int arr[2][4] = {{3, 6, 9, 12}, {2, 4, 6, 8}};
No, the answer is D, the array doesn't have a fourth index that's the issue. Of course, the array has 4 #'s held, but it does not have the specific 4th index it's asking for. This will ultimately result in a random number being printed since the fourth one doesn't exist.
🚀 Loved the tutorial? Take it further with Programiz PRO!
Refine your skills, conquer coding fears, and build confidence with interactive lessons, quizzes, and challenges. Strengthen your programming foundation and master C today!
👉Start Here: bit.ly/c-master
Love you from Nepal. Full support for our best team in Nepal 🇳🇵 .
Timestamps:
00:00 Start
00:20 C Multidimensional Arrays
00:39 Declaration multidimensional array
01:17 Initialization of multidimensional array
02:49 Access Array Elements
04:57 Change Array Indexes
06:56 Multidimensional Array and for loop
10:14 Quiz
These videos have been the best if you want to understand C programming concepts quickly
Tq ...plz continue the videos we are waiting for more of c programming
Random value is the answer coz there are only 4 elements in the second inner array , and indexes start from 0 , so 4th index number does not exist .
Gj
actually the answer is 0 and not random value...random value is generated when extra spaces are available and youre trying to print them....eg...youre given 5 index space to the array and only 2 are filled...then if u try to access the 4th index...u get random value...in this case it is different...
@@AnushasitCoderu get a random value, check the ans in their website
You are correct (answer: random).
The answer is 0, i did it for myself...
Clean explanation as always! Thank you very much...
This is helping me with collage. thank you a ton.
Big like from me! I discovered your website looking for code snippets. Your channel is fantastic for a C beginner!
most straightforward explanation .
Your videos are super clear & helpful!! Thank you!!
Glad you like them!
Love you mam. I started following your classes, but upload the next video as soon as possible.
I love your videos. They're so easy to understand. Thank you so much
focus on what she is trying to teach.
@@prithviraj627 😅
10:17
The code you've provided has an issue when trying to initialize a 2D array a[1][4]. You are trying to assign two rows of data, but the array you've declared can only hold one row with four elements, as specified by a[1][4].
Nice teacher for the Quiz, Random Value is printed. Thanks for sharing
Her voice is really soothing.
I'm loving your voice. It's so calming 💯
You're just amazing mam
Nice teaching
good to watch and easy to learn tq
Thank you so much, Madam
The code
#include
int main() {
int marks[5];
int sum=0;
int average;
printf("Enter the 5 marks:
");
for (int i=0; i
🎉🎉🎉
Q. Which value will we get when we print arr[1][4] from the following array?
int arr[1][4] = { {3, 6, 9, 12}, {2, 4, 6, 8} };
A.12
B. 8
C. 0
D. Random Value
Random value
No Programming Task for this lecture.🙄🙄
C Because if you count 0, the 4th element does not exist.
D.Random value
Random value
amazing teacher😍
Random value will be printed as arr[1][4] doesn't exist..array index out of bounds
thanks have benefited alot
it is error right? becuz it should be int arr[2],[4]????
make me so confused ,the answer is zero , random or error???
thanks bro
isn't the app available for systems?
awesome thankyou soo much ma'am
Vivid explanation. Love your teaching, the answer to the programiz quiz is D
maam the answer will be zeero{0},as it can read upto [1][3],if i am wrong plz let me know.
This is great tutorial it helps me alot
awesome, i have watched all videos prior to this one
Please make video with multidimensional malloc
option D .......as to have array with index 4 the declared array must be arr[1][5] but the declared array isnt
awesome!!
Option D : Random Value
nice
Hello programmiz I suggest you make a postgreSQL series
Random value the matrix is of order 2*4 that doesn't appear in the array
please send me the link for the certificate program.
Loving the videos
10:22 the answer is D, Right?
Why are we using the increment
i just compile this program and it waas eror for too many initializers
thanks
in the above array the size is exceeded because the actual size is arr[1][3] so the the above array pics the value zero because if the array[1][4] has no value to pick by default it will pick zero
The correct answer is D.
The array was initialized as "arr[1][4]" which is incorrect, it should be "arr[2][4]". This causes only the first array to be recognized by the program, so when we try to print "arr[1][4]" (which should be "arr[2][4]" if the array was initialized properly) the value does not exist, therefore a random value will be printed.
Thank you!
option D. Random value
At first i thouhght the answer was B(8),
I then realised that int arr [1][4] is not present in the array elements we have been provided with. [1][4] in this case means that there's only one array with 4 elements in the array . However the numbers displayed {3, 6, 9, 12} , {2, 4, 6, 8} represents two arrays with each having 4 elements, hence the proper representations should be int arr[2][4] = {3, 6, 9, 12} , {2, 4, 6, 8} .
hence for the quiz provided you will get 0
example
#include
int main(){
int arr[2][4] = {{3, 6, 9, 12} , {2, 4, 6, 8}}; //two arrays with 4 elements in each array//
printf("%d ",arr[1][3]); // [0 1 - one is second i.e second array], [0 1 2 3 - 3 is fourth] hence the command asks us to print the fouth element of the second array//
return 0;
}
The output is 8
You're wrong
@@canhtranhLuat the answer is zero mate. Am sure you didn't read the whole comment..i said at first i thought the answer was 8, but after working it out..i.realized it's 0
@@collinshagembe7852 no, the correct ans is Random value
@@canhtranhLuat I think, the answer is 0. She was explaining this issue while she was teaching about arrays. Go and check my friend.
please upload videos on pointers ASAP...
Please do about scope resolution operater
Answer: D
This is because [4] is out of range for arr[1], so it will give a random number.
The correct answer is C since int the second array, we don't have fourth element which in this case it is assumed to be 0.
Option D, But the truth is we don’t even get a random value as arr[1][4] does not exist
Queeze answer is d - random value
option D) random value
Do you have a personal Chanel please?
opt 4 , random value
Can you teach me to program the Chicken Marsalla?
Random value will be the ans for the last question
D is right ans
😲😲
& it prints "CHEERIO" LMAOO 🤣🤣🤣🤣🤣
💓💓💓
D. Random Value
matrix?
beton yetmez beton
A. 12 is the answer,
cant imagine so many people in the comment going berserk over this simple question.
bro watch the video again
12 is [0], [3] btw
The answer to the quiz is option 'D',Random value
Option C is correct
#include
int main() {
// Write C code here
int arr[1][4] = { {3, 6, 9, 12}, {2, 4, 6, 8} };
printf("%d", arr [1] [4]);
return 0;
}
answer is = 0
Answer is D)
Random value as only 1 array is declared so the 2nd array will hold 4 random number
Quiz answer should be a random value
option.8
Ramdom variable mam
maybe random value
I am started to follow this series but I don't know how will it benefit me in practical life
Quiz answer is Random Value
D is answer.
For the quiz, the answer would be C since in the declaration of the multidimensional array, you only put that you have 1 array instead of arr[2][4]. Therefore, the entire second array doesn’t exist, and would print out a 0.
C is wrong it is a random value.
This is because you only get zero when the index of an element was not given in an array that has the capacity of having that particular index.
@@kene583 I was going to say... Just because the other array doesn't exist doesn't mean anything, the fact is there is no 4 index in the first array and from the previous explanations any value that is accessed that doesn't exist in the array (the fourth index) prints out a random number.
answer is D
Is D correct answer?
My Ans is B
Answer is randome value
Please slove syntax program iam watch you video
Opt B
The Answer is D, Random Number.
8
is answer
the answer of quiz is b,8
B.8
Quiz answer : b) 8
the Answer is C:=0
12
//Which value will we get when we print arr[1][4] from the following array? int arr[1][4] = { {3, 6, 9, 12}, {2, 4, 6, 8} }
#include
int main()
{
int arr[2][4] = {{3, 6, 9, 12}, {2, 4, 6, 8}};
for(int i=0; i
4. Ramdom Value
random or zero
This quiz is wrong, it will give an error. Please respond if I am right.
A is the correct answer because array starts from 0 and 1 2 3.
No, the answer is D, the array doesn't have a fourth index that's the issue. Of course, the array has 4 #'s held, but it does not have the specific 4th index it's asking for. This will ultimately result in a random number being printed since the fourth one doesn't exist.
Array starts from 0 when counting take note