#include <iostream.h>
#include <conio.h>
void main()
{
char name[30] ;
int marks[50][50], tot [ 50];
for ( int i = 0; i < 30 ; i++)
{
cout << "\n Enter Name of the student ";
cin >> name [i];
tot[i] = 0;
cout<< "\n Enter marks for 5 subjects : ";
for (int j = 0; j < 5 ; j++)
{
cout<< "\n Sub " << j+1;
cin >> marks[i][j];
tot[i] = tot[i] + marks[i][j];
}
}
clrscr();
cout<<"\n\n Name \t\t Total \n\n";
for( i = 0; i<=18 ; i ++)
{
cout<< name[i] <<"\t\t" << tot[i] << "\n" ;
}
cout<<"\n Press any key to continue..... ";
getch();
clrscr();
cout<<"\n\n Name \t\t Total \n\n";
for( i = 19; i< 30 ; i ++)
{
cout<< name[i] <<"\t\t" << tot[i] << "\n" ;
}
getch();
}
No comments:
Post a Comment