#19 C Arrays | C Programming For Beginners

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

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

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

    🚀 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

    • @AbhiramDeshpande-fe1vi
      @AbhiramDeshpande-fe1vi Год назад +2

      #include
      int main() {
      int marks[5]={50,66,78,84,92};
      int average = (marks[0]+marks[1]+marks[2]+marks[3]+marks[4])/5;
      printf(" the average marks is : %d",average);
      return 0;
      }

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

      @@AbhiramDeshpande-fe1vi I made mine a bit more complex lol.

    • @ShyamSai-tz9bt
      @ShyamSai-tz9bt 2 месяца назад

      Please explain about * pattern

  • @nithyajagadeesh2034
    @nithyajagadeesh2034 18 дней назад +5

    you are helping me pass my university class for c coding, you explain everything my professor tries to explain in 1:30 hours within 10 mins. It is amazing

  • @stealthy_doctor
    @stealthy_doctor 8 месяцев назад +24

    wonderful explanation, i think the answer to the quiz is C. 0 and for the task:
    #include
    #include
    int main() {
    // Write C code here
    int age[6];
    int sum;
    int average;
    printf("Enter 5 Subject's Grades: ");
    for(int i =0;i

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

      No a cell or slot in memory can never be empty there may be a junk value

    • @sammymillan6085
      @sammymillan6085 Месяц назад +1

      @@softwareupdater99he prob meant for age[6] to be age[5]

    • @Sui_yang-p6g
      @Sui_yang-p6g 21 день назад +1

      it should be initialized as sum = 0 first

  • @SauravKumar-vj7ks
    @SauravKumar-vj7ks 2 года назад +36

    Awesome and crisp explanation. Keep making more videos to cover the entire language. Your series is really very crisp ,informational and easily understandable.

  • @hrushikeshtodkari5265
    @hrushikeshtodkari5265 2 года назад +41

    I Like your teaching method. keep posting such contents free for the student.
    thank you.....

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

    [Programiz Video Quiz]
    Q. Which value will we get when we print num[4] from the following array?
    int num[5] = {2, 3, 5};
    1. 2
    2. 5
    3. 0
    4. Random Value

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

    clear, concise and to the point explanation Thank you.

  • @olusamuel7672
    @olusamuel7672 Год назад +24

    The Quiz answer is 0, no digit is stored in that index so automatically it's 0.
    Between I love the way you teach, you make C look easy and have really really learnt a lot from your channel. good job ❤😊

  • @murti1565
    @murti1565 2 года назад +13

    i love it when she says "jero"

  • @joechen9498
    @joechen9498 6 месяцев назад +14

    #include
    int main() {
    int marks[5]={12,13,14,15,16};
    int sum = marks[0]+marks[1]+marks[2]+marks[3]+marks[4];
    printf("%d" ,sum);
    int average = sum/5;
    printf("%d" , average);
    return 0;
    }

    • @yahyaelgandouer3591
      @yahyaelgandouer3591 4 месяца назад

      Do the sum in a loop

    • @Salamanca-joro
      @Salamanca-joro 3 месяца назад

      ​@@yahyaelgandouer3591
      I did it like he did it at first but after your comment this is my new code :
      #include
      Int main ()
      {
      Double grade[5] = { 75.55 , 55.55 , 99.55 , 67.65 , 32.22 }
      Double sum = 0;
      for ( int i = 0 ; i < 5 ; i++ )
      {
      Sum = sum + grade[i] ;
      }
      Double average = sum / 5 ;
      Printf(" the average grade for the student is %.2f " , sum )
      Return 0 ;
      }

    • @johnlouiesingculan-tw3gx
      @johnlouiesingculan-tw3gx 2 месяца назад

      bogoas giatay oy

    • @oie328
      @oie328 23 дня назад

      @@yahyaelgandouer3591 how? (can u send the sintax of the code)
      my try: for(int i=0; i

    • @yahyaelgandouer3591
      @yahyaelgandouer3591 22 дня назад

      @@oie328 if you do the return sum in the loop, the program will go out of the loop
      it is right exept return line
      better version
      #include
      int main(){
      int sum;
      int marks[5];
      int average;
      for(int i = 0; i < 5 ; i++){
      printf("write the mark of the %dth subject ", i+1);
      scanf("%d", &marks[i]);
      sum += marks[i];
      };
      average = sum /5;
      printf("The average is %d", average);
      return 0;
      };
      Good Luck

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

    am yet to find best teacher thank you for your content it really makes it easier to learn and grasp info on c programming.

  • @saladevamanikanta6788
    @saladevamanikanta6788 2 года назад +4

    mam! i did it, lots of thanks for you by adding the addition points to it. Thanks a lot mam.
    /* Create a program that computes the average marks of a
    student.
    1. Create an array that stores the marks of n subjects.
    2. Compute the total marks by adding all the marks.
    3. Divide the total marks by total number of subjects.
    4. Compute the percentage.
    5. Print the average marks and percentage and total marks. */
    #include
    #include
    int main()
    {
    int subs, subs1, total_marks = 0, array[100], entire_total;
    float average, percentage;
    clrscr();
    printf("Enter how many subjects you have: ");
    scanf("%d", &subs);
    printf("The Entire Total marks of the subjects are: ");
    scanf("%d",&entire_total);
    for(subs1 = 0; subs1 < subs; subs1++)
    {
    printf("Enter the score in subject%d : ", subs1);
    scanf("%d", &array[subs1]);
    }
    for(subs1 = 0; subs1 < subs; subs1++)
    {
    total_marks = total_marks + array[subs1];
    }
    average = (float)total_marks / subs;
    percentage = ((float)total_marks / entire_total ) * 100;
    printf("
    The Total marks of the subjects out of %d : %d", entire_total,total_marks);
    printf("
    The Average marks of the subjects are: %.3f", average);
    printf("
    The Percentage of all subjects according to your marks: %.3lf %", percentage);
    getch();
    return 0;
    }

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

    this is helping me a lot, i always use programiz terminal when i want to try something quick and it is really helpful. Now those classes are helping me understand even more.

  • @nyangparker4195
    @nyangparker4195 9 месяцев назад +1

    woah! you are great in explaining c programming. sorry my English is not that good, but yours was good enough to make me understand it very well. thankyou! i hope to see more videos from you!

  • @NoumanAhmedMomin
    @NoumanAhmedMomin 3 месяца назад +1

    very easy to understand and is quite informative with good teaching!!!!!🙂🙂🙂😀😀😀

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

    #include
    #include
    int main(){
    float grades[5];
    int i;
    float sum = 0;
    for(i = 0; i < 5; i++){
    printf("Inserect grades: ");
    scanf("%f", &grades[i]);
    sum = sum + grades[i];
    }
    float average = sum/5;
    printf("The average marks is: %.2f", average);
    return 0;
    }

  • @ravikumarronad7475
    @ravikumarronad7475 2 года назад +43

    Correct Answer is C. 0
    Array of size is 5 so in the given array have 3 elements so remaining 4th and 5th index number store automatically 0 value.
    Pictorial is:
    Int num[5]= { 2, 3, 5, 0, 0}
    Important Note: Array is Collection of Homogenous elements.

    • @akashmathdevru8618
      @akashmathdevru8618 Год назад +2

      no it show random no....because in video saw put value 6 nut it can present 0--4 integer remaining it get random no. so i think D

    • @TiTan-gr3pv
      @TiTan-gr3pv Год назад +7

      ​@@akashmathdevru8618in that case the value she asked for was out of the size of the array so it gave a random value but if you don't store any value willingly inside a particular index of an array the value 0 will be stored in many compilers and some may show an error so it doesn't give an output of a random value

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

      @@akashmathdevru8618 0 comes when u acess a element that does not exist, random value comes when you access a array index grater than the maximum lenght specified when declared.

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

    One of the best teaching method, please go ahead and make more contents like this

  • @2snish
    @2snish 2 года назад +4

    Thank you !
    Great explanation,Simple but precise and also great initiative on making this videos available to all !

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

    Haa nhasi ndopandatozonzwisisa ma array after a long time. Well done parohwa basa apa🙌🤝

  • @Sagar_Nath629
    @Sagar_Nath629 3 месяца назад +1

    Thanks mam! It really helped me and I love to use this C compiler

  • @Saint-Phillemon
    @Saint-Phillemon 7 месяцев назад

    I love her english, so different and unique to grasp even better

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

    You are a representation for "Education must be free"

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

    your understanding is so good

  • @Basu-x2d
    @Basu-x2d 2 месяца назад +1

    Nice explanation mam❤

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

    Iperhaps one of the greatest teaching on c language fundamentals in India from my experience with teachers

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

    Great and simply explained too good
    And the answer is( c) . 0

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

    Thabks alot this woll surely hwlp me for today HND exams i have .

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

    I Like your teaching method. keep posting such contents free for the student. Thank you answer is 0

  • @shadyzmartinez
    @shadyzmartinez 10 месяцев назад +1

    i found it interesting 😊 i like it

  • @MupenziJeanFelix-wk9rx
    @MupenziJeanFelix-wk9rx Год назад +1

    hello. I like however you teach or share us about your skills. thank you alot.

  • @yutadagoat-p7b
    @yutadagoat-p7b 2 года назад +2

    #include
    int main() {
    int subjmarks[5];
    printf("enter marks of 5subjects: ");
    for(int s=0;s

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

    in the for loop you had an input of 16 but printed out as 6 in the compiler, what could be the problem

  • @swapnildargude284
    @swapnildargude284 2 года назад +4

    #include
    int main()
    {
    int marks[5];
    int i,sum=0,average;
    printf("Enter marks of 5 subjects");
    for (i = 0; i

  • @SumitSingh-ov6ws
    @SumitSingh-ov6ws 2 года назад +20

    Programming task: /*Create a program that computes the average marks of a student.
    Create and array that stores the marks of 5 subjects;
    Compute the total marks by adding all the marks;
    Divide the total marks by the total number of subjects;
    Print the average marks. */
    #include
    main()
    {
    int i;
    int sum=0;
    int marks[5];
    for(i=0;i

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

      Thnx broo

    • @ntwadumela7
      @ntwadumela7 Год назад +2

      Good but its good programming practice that you initialize avg as int avg and then add avg=sum/5 and print it.

    • @andrewsterling895
      @andrewsterling895 Год назад +2

      I suggest you remove the printf("Entre the marks "); out of the for loop.

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

      I appreciate this. I missunderstood the wording of the quiz and this made me understand what she was asking for

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

    The answer is C, 0. Since the Array has been assigned 5 , and only three integers from 0 to 2 have been filled in. Therefore, 3 and 4 will be filled in with 0's.

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

      How about in the for loop example? Why did age[5] printed random values instead of 0?

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

    thank you very very very much, you help me a lot

  • @war.blitzee7985
    @war.blitzee7985 2 года назад +1

    Thank you very much for these videos. Your websites also give excellent content. Keep up the great work.

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

    Thank you so much ❤

  • @Codingwithmudasir
    @Codingwithmudasir Месяц назад +1

    Good Video

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

    nice class and this are best in business

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

    This is the best videos!

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

    Assomone explanation mam👍👍👍👍

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

    At 11:25 why u used ++i instead of i++

  • @basittahir-w2v
    @basittahir-w2v 9 дней назад

    Hey,
    We will get Random Value when we print num[4].

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

    Nice explanation than college! 💪🛡️

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

    Arrays is very easy with you.

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

    Thank you mam 😊

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

    Excellent to understanding... Tqsm mam...

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

    8:48 why the output is not 25, and what if i want 25 what should i do?

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

    I really like your explanation.....

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

    Thank you so much for the video !

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

    At 11:30 it printed 6 instead of 16 .. Why? 😳

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

    best channel ever thank you hanım abla

  • @BWM.LIFE-FOUNDATION-tv
    @BWM.LIFE-FOUNDATION-tv Год назад

    Nice my teacher 🙏🙏🎉🎉

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

    11:28 shouldn’t printf be in scanf’s place and vice versea?

  • @amenabegumakhi4521
    @amenabegumakhi4521 4 месяца назад

    thanks sis

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

    #include
    int main()
    {
    int i;
    double avg;
    double marks[5];
    printf("Enter marks of 5 subjects:");
    for(i=0 ;i

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

    #include
    int main() {
    float mark [5];
    float sum=0;
    float acumulador = 0,average=0;

    printf("Enter subject marks: ");

    for (int i = 0 ; i < 5; ++i) {
    scanf("%f", &mark[i]);
    sum=sum+mark[i];
    acumulador =acumulador+mark[i];
    }
    printf("sum is %f
    ",sum);
    printf("average is %f
    ",acumulador/5);

    }

  • @hrushikeshtodkari5265
    @hrushikeshtodkari5265 2 года назад +7

    D. Random value

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

      I guess you haven't considered the size of the array, so it is 0.

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

    int main(){
    int n;
    printf("Enter the number of subjects
    ");
    scanf("%d",&n);
    float a[n];
    float sum=0.0;
    float average;
    for(int i=0;i

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

    at 11.30 why did the output come as 6 instead of 16 ?

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

      I did notice too. Just guessing, but might be a bug in the compiler?

  • @Nounare
    @Nounare 28 дней назад

    I love this girl 🎀

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

    Happy programming 🎉

  • @zindycangaming9851
    @zindycangaming9851 2 месяца назад +1

    10:57 the output is wrong it hast to be 16 but it is 6...

  • @Sara.j-hk4my
    @Sara.j-hk4my Год назад

    #include
    int main( )
    { int marks[5], i;
    int sum=0;
    float avg;
    for(i=0;i

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

    guyz haru ta nepali po raixan so proud of that

  • @user-mr3mf8lo7y
    @user-mr3mf8lo7y Год назад

    Thanks a bunch.

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

    13:09 the answer is 0 right?

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

    very nice video 😊😊😊❤❤❤🙏mam

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

    11:28 you entered 16 in the 3rd index but the output was 6 😮

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

    Nice explanation mam

  • @anesp.a913
    @anesp.a913 2 года назад +3

    The output of that code is option (d) Random Value

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

      That's what I thought, apparently their github repository says different.

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

      @@maxwell4466 Can you provide me their gitHub repository link?

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

    I love her accent ❤️☺️

  • @shivaprasad._.08
    @shivaprasad._.08 2 года назад

    Superb explanation 🙏

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

    programming task-
    int marks[5];
    printf(" Enter the marks of 5 different subjects of a student:");
    for (int i=0; i

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

    Great Explanation, Thank you for the same.

  • @DhoniMama-kj5ur
    @DhoniMama-kj5ur 3 месяца назад +1

    8:41 you can automatically by keyboard na why are u using age[2]?

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

    13:07 --> C. 0

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

    Thank you mam give more things of array,🥰🥰

  • @chidozie.o
    @chidozie.o 10 месяцев назад

    so good👌

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

    Do a video of array using DEV C++

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

    #include
    int main()
    {
    int marks_sub[5] = {60,70,54,82,50};
    float total_marks=0, avg_marks;
    //total_marks = marks_sub[0] +
    for (int i=0;i

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

    thanks

  • @ElHipokondriako
    @ElHipokondriako Год назад +2

    11:27 somehow returned "6" instead of "16" in age[3]?

  • @Insertnotrealname
    @Insertnotrealname Месяц назад

    Commenting to increase engagement.

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

    Finally, here's my code! :>
    #include
    int main()
    {
    int marks[5];
    float sum;
    float ave;
    printf("Enter 5 marks of a student:
    ");
    for(int i = 0;i < 5;i++)
    {
    int a = i + 1;
    printf("Subject %d: ", a);
    scanf("%d", &marks[i]);
    }
    sum = marks[0] + marks[1] + marks[2] + marks[3] + marks[4];
    ave = sum/5;
    printf("The sum is: %.2f", sum);
    printf("
    The average is: %.2f", ave);
    return 0;
    }

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

    When changing the value of the array age[2] from 25 to 26, why wasn't it changed directly inside the int function? 8: 48 is the video time. Someone please help me understand this.

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

    thanks a lot

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

    int main()
    {
    int ave,sum;
    int student_marks[5];
    printf("Enter student marks :",student_marks[5]);
    scanf("%d%d%d%d%d",&student_marks[5]);
    {
    sum=student_marks[5]++;
    printf("Total mark is :
    ",sum);
    }

    ave=sum/5;
    printf("Avarage mark is:%d",ave);

    return 0;
    }

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

    May I know where we can use new line character "/n"

  • @lamaspacos
    @lamaspacos 10 месяцев назад

    11:30 and 11:55 A problem with the 4th element ! (?)😅

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

    #include
    int main() {
    // Create an array that stores the marks of 5 subjects
    int marks[] = {75, 80, 85, 90, 95};
    // Compute the total marks by adding all the marks
    int total_marks = 0;
    for (int i = 0; i < 5; i++) {
    total_marks += marks[i];
    }
    // Divide the total marks by total number of subjects
    int number_of_subjects = sizeof(marks) / sizeof(marks[0]);
    float average_marks = (float)total_marks / number_of_subjects;
    // Print the average marks
    printf("Average marks: %.2f
    ", average_marks);
    return 0;
    }

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

  • @NCW06
    @NCW06 4 месяца назад +1

    it will return 0,because we created 5 element array with 5 index value 0-4 we not assign any value to index 3 and index 4 so it will return null value which will be zero

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

    Animo joel tu puedes

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

    Thank you.

  • @Aditya-fu4jj
    @Aditya-fu4jj 2 года назад

    Thankyou!

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

    i love your videos

  • @KiVi2006
    @KiVi2006 Месяц назад

    Mam how to add elements of 2 arrays?