Q: Write a program that uses a two dimensional array to initialize the scores of students. The students are arranged in five rows with five students in each row. The program inputs the row number and student number in that row and then displays the score of the student.
Program:
#include<iostream.h>
#include<conio.h>
void main()
{
int row,stu, score[5][5]={{45,56,87,33,67}, {56,87,59,76,63}, {76,65,83,43,52} , {65,77,84,69,71}, {56,34,76,85,35}};
clrscr();
cout<<" Enter row number: ";
cin>>row;
cout<<" Enter student number: ";
cin>>stu;
cout<<" Score of the student: "<<score[row-1][stu-1];
getche();
}
really helpful,
ReplyDelete