Back To C++ Double Dimensional Arrays Index
//program to input marks of 3 students in 3 subjects and find average and total (example of double dimensional arrays) #include
#include
void main() { int marks[3][3]; int i,j; int total[3]={0,0,0}; float avg[3]={0.0,0.0,0.0}; clrscr(); for(i=0;i<3;i++) { for(j=0;j<3;j++) { cout<<"\nenter marks of student "<
>marks[i][j]; } } for(i=0;i<3;i++) { for(j=0;j<3;j++) { total[i]=total[i]+marks[i][j]; } } for(i=0;i<3;i++) { avg[i]=total[i]/3; } for(i=0;i<3;i++) { cout<<"\ntotal marks of student "<