/*Array of Object */
#include<iostream>
using namespace std;
class Student
{
int roll;
float per;
public:
void accept()
{
cout<<"\n\n Enter Rollno and Percentage: ";
cin>>roll>>per;
}
void display()
{
cout<<"\n\n Rollno: "<<roll;
cout<<"\n Percentage: "<<per;
}
};
int main()
{
int i;
Student s[5];
cout<<"\n\n Enter information of 5 Student:";
for(i=0;i<5;i++)
s[i].accept();
cout<<"\n\n Information of 5 Student:";
for(i=0;i<5;i++)
s[i].display();
return 0;
}
#include<iostream>
using namespace std;
class Student
{
int roll;
float per;
public:
void accept()
{
cout<<"\n\n Enter Rollno and Percentage: ";
cin>>roll>>per;
}
void display()
{
cout<<"\n\n Rollno: "<<roll;
cout<<"\n Percentage: "<<per;
}
};
int main()
{
int i;
Student s[5];
cout<<"\n\n Enter information of 5 Student:";
for(i=0;i<5;i++)
s[i].accept();
cout<<"\n\n Information of 5 Student:";
for(i=0;i<5;i++)
s[i].display();
return 0;
}