/*Create
a C++ class S tud e nt w ith data
members Roll_no, S_Name,
Class, Percentage. Accept
twostudents information and display inform ation of student having
maxim um percentage. (Use
this pointer)*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
class
student {
public:
int
id,per; //data member (also instance variable)
char
name1[40],class1[40]; //data member(also instance variable)
{
cout<<"\n
Enter id:";
cin>>id;
cout<<"\n
Enter name :";
cin>>name1;
cout<<"\n
Enter the class:";
cin>>class1;
cout<<"\n
Enter the per:";
cin>>per;
{
cout<<"\n Student Id:-"<<this->id;
cout<<"\n
Student name:-"<<this->name1;
cout<<"\n
Student class:-"<<this->class1;
cout<<"\n
Student per:-"<<this->per;
}
};
void main()
{
for(int i=0;i<2;i++)
{
t[i].display();
}
int
temp=0;
for(i=0;i<=1;i++)
{
if(t[temp].per<t[i].per)
temp=i;
}
cout<<"\n
STUDENT with Highest Per is : "<<t[temp].per;
cout<<"
\n And, STUDENT Name is : "<<t[temp].name1;
}