Calculating Name and Marks in Cpp
Calculating Name and Marks in Cpp
#include<conio.h>
using namespace std;
int main()
{
int x[5];
char Name[5][20];
cout<<"Enter Name ..\t"<<"Enter Marks .."<<endl<<endl;
for(int i=0; i<5; i++)
{
cout<<" ";cin>>Name[i];
cout<<"\t \t"; cin>>x[i];
}
int Max=0;
Max=x[0];
int loc=0;
for(int i=1; i<5; i++)
{
if(Max < x[i])
{
Max= x[i];
loc= i;
}
}
cout<<endl<<"Maximum Num is ..."<<Max;
cout<<endl<<"Name is.. "<<Name[loc];
getch();
}
Comments
Post a Comment