February 26th, 2022
[Scroll to the bottom of this page to discuss stuff].
(This is an extension of Q6 from 2D-Arrays in C-Class-7).
There are 5 subjects and each subject can have any number of students in it.
WAP to input the marks of each student in each subject. Now print the average marks of each subject.
Hint: you should use jagged arrays.
Basically it’s a 2D array with a variable number of rows and columns. You must use dynamic memory allocation to create such data structure. eg.,
{ {12, 56, 86},
{23, 45, 67, 56},
{34, 56},
{45, 67, 89},
{56, 78, 90} }
This is a reminder to keep practicing questions from CodeForces/ CodeChef/ HackerRank/ HackerEarth.