#20 C Multidimensional Arrays | C Programming For Beginners

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 215

  • @programizstudios
    @programizstudios  2 года назад +9

    🚀 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

  • @KamalPoudel-h1f
    @KamalPoudel-h1f 10 месяцев назад +2

    Love you from Nepal. Full support for our best team in Nepal 🇳🇵 .

  • @programizstudios
    @programizstudios  2 года назад +16

    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

  • @KELVINWAINAINA-hs7wq
    @KELVINWAINAINA-hs7wq 8 месяцев назад +11

    These videos have been the best if you want to understand C programming concepts quickly

  • @nanimg3512
    @nanimg3512 2 года назад +10

    Tq ...plz continue the videos we are waiting for more of c programming

  • @ashutoshm.5920
    @ashutoshm.5920 2 года назад +96

    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 .

    • @ethanflorko496
      @ethanflorko496 Год назад +1

      Gj

    • @AnushasitCoder
      @AnushasitCoder 11 месяцев назад +4

      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...

    • @juliotitosagastegui9453
      @juliotitosagastegui9453 10 месяцев назад +2

      @@AnushasitCoderu get a random value, check the ans in their website

    • @JoseCarv0
      @JoseCarv0 9 месяцев назад

      You are correct (answer: random).

    • @bekmirzo_berdimurodov
      @bekmirzo_berdimurodov 8 месяцев назад +1

      The answer is 0, i did it for myself...

  • @user-nt4nm4fb3u
    @user-nt4nm4fb3u 11 месяцев назад +3

    Clean explanation as always! Thank you very much...

  • @anthonyatienza3363
    @anthonyatienza3363 Год назад +3

    This is helping me with collage. thank you a ton.

  • @dcpowered
    @dcpowered 3 месяца назад

    Big like from me! I discovered your website looking for code snippets. Your channel is fantastic for a C beginner!

  • @jip1521
    @jip1521 Год назад +1

    most straightforward explanation .

  • @amayaamarasinghe5838
    @amayaamarasinghe5838 2 года назад +12

    Your videos are super clear & helpful!! Thank you!!

  • @gopalbathula1327
    @gopalbathula1327 2 года назад +2

    Love you mam. I started following your classes, but upload the next video as soon as possible.

  • @mosopefoluwaadebawojo3543
    @mosopefoluwaadebawojo3543 2 года назад +6

    I love your videos. They're so easy to understand. Thank you so much

    • @prithviraj627
      @prithviraj627 2 года назад +1

      focus on what she is trying to teach.

    • @AaravMakan
      @AaravMakan 2 года назад

      @@prithviraj627 😅

  • @monexsharma3761
    @monexsharma3761 День назад

    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].

  • @jeffersonmaingi
    @jeffersonmaingi 7 месяцев назад

    Nice teacher for the Quiz, Random Value is printed. Thanks for sharing

  • @tafsirnahian669
    @tafsirnahian669 2 года назад +2

    Her voice is really soothing.

  • @spinash7864
    @spinash7864 2 года назад

    I'm loving your voice. It's so calming 💯

  • @akashmeesarapu6438
    @akashmeesarapu6438 2 года назад +2

    You're just amazing mam
    Nice teaching

  • @acemaster65
    @acemaster65 Год назад +1

    good to watch and easy to learn tq

  • @nihatdonmzov4166
    @nihatdonmzov4166 2 года назад +2

    Thank you so much, Madam

  • @denkyitehillah7449
    @denkyitehillah7449 5 месяцев назад +3

    The code
    #include
    int main() {
    int marks[5];
    int sum=0;
    int average;
    printf("Enter the 5 marks:
    ");
    for (int i=0; i

  • @programizstudios
    @programizstudios  2 года назад +20

    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

  • @b7sh_b7sh
    @b7sh_b7sh Год назад

    amazing teacher😍

  • @siddharthabandyopadhyay5964
    @siddharthabandyopadhyay5964 2 года назад +6

    Random value will be printed as arr[1][4] doesn't exist..array index out of bounds

  • @sebiddeusama9113
    @sebiddeusama9113 2 месяца назад

    thanks have benefited alot

  • @jackyjaii2154
    @jackyjaii2154 2 года назад +2

    it is error right? becuz it should be int arr[2],[4]????
    make me so confused ,the answer is zero , random or error???

  • @thesun___
    @thesun___ Год назад +1

    thanks bro

  • @crazy_me00
    @crazy_me00 6 месяцев назад

    isn't the app available for systems?

  • @idealworld142
    @idealworld142 2 года назад

    awesome thankyou soo much ma'am

  • @albertamenyah3019
    @albertamenyah3019 Год назад

    Vivid explanation. Love your teaching, the answer to the programiz quiz is D

  • @Abhisheksingh-ep2gu
    @Abhisheksingh-ep2gu 2 года назад +1

    maam the answer will be zeero{0},as it can read upto [1][3],if i am wrong plz let me know.

  • @yrroszage870
    @yrroszage870 2 года назад

    This is great tutorial it helps me alot

  • @milanmisli5051
    @milanmisli5051 2 года назад

    awesome, i have watched all videos prior to this one

  • @mrawesome7739
    @mrawesome7739 17 дней назад

    Please make video with multidimensional malloc

  • @vishakanr1478
    @vishakanr1478 2 года назад +2

    option D .......as to have array with index 4 the declared array must be arr[1][5] but the declared array isnt

  • @countrysideshowyaigrock4689
    @countrysideshowyaigrock4689 Год назад

    awesome!!

  • @onic9623
    @onic9623 Год назад +1

    Option D : Random Value

  • @RATANAGARWALITINFORMER
    @RATANAGARWALITINFORMER 2 года назад +1

    nice

  • @buissondecsm7879
    @buissondecsm7879 2 года назад

    Hello programmiz I suggest you make a postgreSQL series

  • @internethippo-p3q
    @internethippo-p3q 5 месяцев назад

    Random value the matrix is of order 2*4 that doesn't appear in the array

  • @emmanuels.k.dekpah
    @emmanuels.k.dekpah 2 года назад

    please send me the link for the certificate program.

  • @aburayhansushmoy110
    @aburayhansushmoy110 2 года назад

    Loving the videos

  • @AM-yd8en
    @AM-yd8en Год назад

    10:22 the answer is D, Right?

  • @judithneumbe-z9r
    @judithneumbe-z9r 2 месяца назад

    Why are we using the increment

  • @pp-quiz
    @pp-quiz 3 месяца назад

    i just compile this program and it waas eror for too many initializers

  • @saisunkara1696
    @saisunkara1696 Год назад +4

    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

  • @red1iteee
    @red1iteee Год назад +7

    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.

  • @harshchauhan4945
    @harshchauhan4945 2 месяца назад

    option D. Random value

  • @collinshagembe7852
    @collinshagembe7852 Год назад +1

    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
      @canhtranhLuat Год назад

      You're wrong

    • @collinshagembe7852
      @collinshagembe7852 Год назад

      @@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

    • @canhtranhLuat
      @canhtranhLuat Год назад

      @@collinshagembe7852 no, the correct ans is Random value

    • @TemesgenAlemu-b7w
      @TemesgenAlemu-b7w 5 месяцев назад

      @@canhtranhLuat I think, the answer is 0. She was explaining this issue while she was teaching about arrays. Go and check my friend.

  • @manikumargannavarapu8123
    @manikumargannavarapu8123 2 года назад

    please upload videos on pointers ASAP...

  • @sltechgalaxy1677
    @sltechgalaxy1677 2 года назад

    Please do about scope resolution operater

  • @has2236
    @has2236 Год назад

    Answer: D
    This is because [4] is out of range for arr[1], so it will give a random number.

  • @TemesgenAlemu-b7w
    @TemesgenAlemu-b7w 5 месяцев назад

    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.

  • @sibinp17
    @sibinp17 Год назад +3

    Option D, But the truth is we don’t even get a random value as arr[1][4] does not exist

  • @umac287
    @umac287 Год назад +5

    Queeze answer is d - random value

  • @aminshaikh4592
    @aminshaikh4592 2 года назад

    option D) random value

  • @yousifmerza5578
    @yousifmerza5578 2 года назад

    Do you have a personal Chanel please?

  • @yogithabale
    @yogithabale 6 месяцев назад

    opt 4 , random value

  • @fredambrose
    @fredambrose 3 месяца назад

    Can you teach me to program the Chicken Marsalla?

  • @suvrojit2004
    @suvrojit2004 Год назад

    Random value will be the ans for the last question

  • @prajapatiajay
    @prajapatiajay 2 года назад

    D is right ans

  • @GATE318
    @GATE318 2 года назад +2

    😲😲

  • @alanizaguirre4670
    @alanizaguirre4670 2 года назад +1

    & it prints "CHEERIO" LMAOO 🤣🤣🤣🤣🤣

  • @priyeshkr18
    @priyeshkr18 8 месяцев назад

    💓💓💓

  • @kareemtawfik2886
    @kareemtawfik2886 Год назад

    D. Random Value

  • @Leverquin
    @Leverquin 8 дней назад

    matrix?

  • @yigitcamas229
    @yigitcamas229 Год назад

    beton yetmez beton

  • @InsaneMedusa
    @InsaneMedusa 2 года назад +1

    A. 12 is the answer,
    cant imagine so many people in the comment going berserk over this simple question.

  • @teju_vasuchannel2080
    @teju_vasuchannel2080 Год назад

    The answer to the quiz is option 'D',Random value

  • @duggisuguna4908
    @duggisuguna4908 2 года назад

    Option C is correct

  • @barkhadibraahim1023
    @barkhadibraahim1023 2 года назад

    #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

  • @balashebjadhav977
    @balashebjadhav977 Год назад

    Answer is D)

  • @onihasan2576
    @onihasan2576 Год назад

    Random value as only 1 array is declared so the 2nd array will hold 4 random number

  • @SavarahMarian
    @SavarahMarian 9 месяцев назад

    Quiz answer should be a random value

  • @soumadeepdas7610
    @soumadeepdas7610 2 года назад +1

    option.8

  • @ghema9515
    @ghema9515 Год назад

    Ramdom variable mam

  • @bibeklimbu-nt4ff
    @bibeklimbu-nt4ff 8 месяцев назад

    maybe random value

  • @muznahhussain1321
    @muznahhussain1321 2 года назад +1

    I am started to follow this series but I don't know how will it benefit me in practical life

  • @ivanurilski3157
    @ivanurilski3157 2 года назад

  • @adityad8929
    @adityad8929 Год назад

    Quiz answer is Random Value

  • @gazalaperween9602
    @gazalaperween9602 2 года назад

    D is answer.

  • @kaileebrennecke8515
    @kaileebrennecke8515 2 года назад +5

    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.

    • @kene583
      @kene583 2 года назад +6

      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.

    • @ethanflorko496
      @ethanflorko496 Год назад

      @@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.

  • @zuko8023
    @zuko8023 7 месяцев назад

    answer is D

  • @thecyber465
    @thecyber465 2 года назад

    Is D correct answer?

  • @vinaykumarvinaykumar2006
    @vinaykumarvinaykumar2006 2 года назад

    My Ans is B

  • @movietime7062
    @movietime7062 2 года назад

    Answer is randome value

  • @shahmeerakbar2045
    @shahmeerakbar2045 2 года назад

    Please slove syntax program iam watch you video

  • @Bestinfo3690
    @Bestinfo3690 5 месяцев назад

    Opt B

  • @bullshit485
    @bullshit485 2 месяца назад

    The Answer is D, Random Number.

  • @DARKEMPIRE-1
    @DARKEMPIRE-1 2 года назад

    8
    is answer

  • @xxxegster6527
    @xxxegster6527 Год назад

    the answer of quiz is b,8

  • @JOSEPHMUKAMA-v3b
    @JOSEPHMUKAMA-v3b Год назад

    B.8

  • @mulareddy2624
    @mulareddy2624 2 года назад

    Quiz answer : b) 8

  • @bilecode8114
    @bilecode8114 2 года назад +1

    the Answer is C:=0

  • @IphOne-kb3bj
    @IphOne-kb3bj 2 года назад +2

    12

  • @thulasizwephetha8211
    @thulasizwephetha8211 2 года назад +3

    //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

  • @jackyjaii2154
    @jackyjaii2154 2 года назад

    random or zero

  • @pulkitgupta8344
    @pulkitgupta8344 2 года назад

    This quiz is wrong, it will give an error. Please respond if I am right.

  • @safiullahmayar6153
    @safiullahmayar6153 2 года назад +1

    A is the correct answer because array starts from 0 and 1 2 3.

    • @ethanflorko496
      @ethanflorko496 Год назад

      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.

    • @LizaOG
      @LizaOG Год назад +1

      Array starts from 0 when counting take note