C++ Program To Calculate The Average For 10 Students In 5 Courses

Computer science program using C++ language to calculate the sum and average of 10 students in 5 different courses. Note that c++ is case sensitive. There are two loops in this program. The first loop to read in the names of 10 students and the second loop which is within the first loop is to read in the scores in each courses. The first loop is incremented when the second inner loop is completed.

Tracing through the program we have the predecessor directives, next is declarations. The identifer 'nos' specifies the number of students. Then 'noc' the number of courses. 'Score' is declared as an array, while 'sum' and 'ave' as integers.

#include <iostream.h>
#include <conio.h>
void main ()
const int nos=10;
const int noc=5;
char name [nos];
float scores [nos][noc];
float sum[nos], ave[nos];
int i,j;

    for (i=1;i<nos; i++)
      cout<<"Enter name of student: "<<i<<endl;
           cout<<" enter the score: "<<j<<endl;
           cin>> score[i][j];


    cout<<"Average Score For"<<" "name<<" "<<ave[i]<<endl;


Tech blogger, SEO expert, cryptocurrency enthusiast, and freelancer are the terms that describe me. I'll rather write a thousand words than speak hundred words, and that describes my passion as a content creator.