#19 C Arrays | C Programming For Beginners

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

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

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

    Finding C programming hard? We’ve got you!
    🚀Get 60% off on Programiz PRO Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer!
    👉Grab your discount now: bit.ly/blkfriday-24-yt

    • @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 14 дней назад

      Please explain about * pattern

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

    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 28 дней назад

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

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

    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 14 дней назад

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

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

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

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

    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 ❤😊

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

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

  • @joechen9498
    @joechen9498 4 месяца назад +7

    #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 2 месяца назад

      Do the sum in a loop

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

      ​@@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 11 дней назад

      bogoas giatay oy

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

    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 11 месяцев назад +1

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

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

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

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

    clear, concise and to the point explanation Thank you.

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

    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.

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

    [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

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

    #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;
    }

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

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

    #include
    int main() {
    // Write C code here
    int marks[5]={56,45,67,87,56};
    int totalMarks = marks[0] + marks[1] + marks[2] + marks[3] + marks[4];
    double averageMarks= totalMarks/5.0;
    printf("The total marks scored = %d
    ",totalMarks);
    printf("The averageMark = %.2lf
    ",averageMarks);
    return 0;
    }

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

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

  • @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;
    }

  • @nyangparker4195
    @nyangparker4195 6 месяцев назад +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!

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

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

  • @zindycangaming9851
    @zindycangaming9851 14 дней назад

    You are a representation for "Education must be free"

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

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

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

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

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

  • @francismally2468
    @francismally2468 15 дней назад

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

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

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

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

    i love it when she says "jero"

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

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

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

    your understanding is so good

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

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

  • @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);

    }

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

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

  • @saiphanikrishnathallam5599
    @saiphanikrishnathallam5599 11 месяцев назад

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

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

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

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

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

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

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

    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

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

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

  • @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;
    }

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

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

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

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

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

    ANSWER
    #include
    int main()
    {
    int i;
    int marks[5];
    int total=0;
    printf("enter the marks: ");
    for(i=0;i

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

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

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

    guyz haru ta nepali po raixan so proud of that

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

    nice class and this are best in business

  • @marusukech.5049
    @marusukech.5049 2 года назад

    programming task:
    #include
    int aver(int total){
    int average = total / 5;
    return average;
    }
    int main(){
    int subjects[5];
    printf("Enter the marks:");
    for(int i = 0;i < 5;++i){
    scanf("%d", &subjects[i]);
    }
    int total;
    for(int i = 0;i < 5;++i){
    total = total + subjects[i];
    }
    int average = aver(total);
    printf("
    Average marks: %d", average);
    return 0;
    }

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

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

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

    I might be wrong but the answer to the question in the end is Random value, option (D)

  • @bullshit485
    @bullshit485 28 дней назад +1

    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 9 часов назад

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

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

    Ans is - D. Random value because we are trying to access uninitialized value

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

    This is the best videos!

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

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

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

    #include
    int main() {
    int mark[5];
    printf("Enter marks of 5 subject:
    ");
    int sum = 0;
    for(int i = 0; i < 5; ++i) {
    scanf("%d", &mark[i]);
    sum = sum + mark[i];
    }
    int averageMarks = sum/5;
    printf("average marks is %d", averageMarks);
    return 0;
    }

  • @NCW06
    @NCW06 2 месяца назад +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

  • @lynne.5416
    @lynne.5416 Год назад +2

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

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

    I really like your explanation.....

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

    Excellent to understanding... Tqsm mam...

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

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

    Arrays is very easy with you.

  • @ItsAndroidDeveloper
    @ItsAndroidDeveloper 11 месяцев назад

    I love programmiz😊😊😊 5:11

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

    Thank you mam 😊

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

    // Online C compiler to run C program online
    #include
    int main() {
    int marks[5];
    double total = 0;
    double average;
    printf("Enter marks for the five subjects: ");
    for (int i = 0; i < 5; i++) {
    scanf("%d", &marks[i]);
    total = total + marks[i];
    }
    printf("
    The total marks is %.2lf ", total);
    average = total / 5;
    printf("
    The average is %.2lf ", average);
    return 0;
    }

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

    Animo joel tu puedes

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

    best channel ever thank you hanım abla

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

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

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

    #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;
    }

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

    Assomone explanation mam👍👍👍👍

  • @muzahidul1832
    @muzahidul1832 12 дней назад

    Thank you so much ❤

  • @AhmadAlMassry-d2t
    @AhmadAlMassry-d2t Год назад +1

    double number[5];
    printf("Enter the number: ");
    scanf("%lf %lf %lf %lf %lf", &number[0],&number[1],&number[2],&number[3],&number[4]);
    double add = (number[0]+number[1]+number[2]+number[3]+number[4]);
    double sum = add / 5;
    printf("%lf", sum);

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

    I love her accent ❤️☺️

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

    Thank you so much for the video !

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

    int marks[5];
    printf("Write down the 5 numbers: ");
    for(int i= 0;i < 5; ++i) {
    scanf("%d", &marks[i]);
    }
    int avg = ((marks[0] + marks[1] + marks[2] + marks[3] + marks[4]) /5 ) ;
    printf("Result = %d",avg);
    return 0;
    }

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

    i found it interesting 😊 i like it

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

    #include
    int main(){
    int marks[5];
    int total=0;
    for(int i=0;i

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

    thanks sis

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

    Option C : 0
    -----------------------------------------------------------------------------
    #include
    int main()
    {
    int marks[5], total = 0;
    printf("Enter Marks Of Five Subjects : ");
    for(int i =0; i < 5; i++)
    {
    scanf("%d", &marks[i]);
    total = total + marks[i];
    }
    printf("Average Mark = %d", total/5);
    return 0;
    }

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

    Nice explanation mam

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

    Thanks a bunch.

  • @chaidiariess
    @chaidiariess 11 месяцев назад

    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;
    }

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

    Happy programming 🎉

  • @BWM.LIFE-FOUNDATION-tv
    @BWM.LIFE-FOUNDATION-tv 11 месяцев назад

    Nice my teacher 🙏🙏🎉🎉

  • @Jeff-qr8eo
    @Jeff-qr8eo 5 месяцев назад

    I understand this more than from my class lol.

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

    Great Explanation, Thank you for the same.

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

    PROGRAMINNG TASK :-
    #include
    int main(){

    int sub[5];
    printf("enter the marks of five subjects(0-100) :
    ");
    int total=0;
    for(int i=0;i

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

      I executed this same code but unable to get average as output

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

      I executed this same coding but unable to get average as output

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

    #include
    #define A 5
    int main ()
    {
    int age[A];
    int sum=0;
    double b=0;
    printf("enter 5 numbers here : ");
    for(int i=0;i

  • @pashamreddy7926
    @pashamreddy7926 Год назад +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?

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

    Nice explanation than college! 💪🛡️

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

    so good👌

  • @shivaprasad._.08
    @shivaprasad._.08 Год назад

    Superb explanation 🙏

  • @nagashreenb4763
    @nagashreenb4763 16 дней назад

    int main()
    {
    int subject[5],i,Totalmark,average;
    printf("enter the subject marks:");
    for( i=0;i

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

    #include
    int main(){
    double marks[5];
    int i;
    double sum = 0;

    for(i = 0;i

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

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

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

    Thank you mam give more things of array,🥰🥰

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

    int main() {

    int marks[5],sum,avg,x;
    printf("Please enter the grades of 5 students:
    ");
    for(x=0;x

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

    thanks

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

    thanks a lot

  • @Aditya-fu4jj
    @Aditya-fu4jj Год назад

    Thankyou!

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

    Thank you.

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

    very nice video 😊😊😊❤❤❤🙏mam

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

    i love your videos

  • @augustinekamara-kz2hb
    @augustinekamara-kz2hb Год назад

    Great