Write a function display () in C++ to display all the students who have got a distinction(scored percentage more than or equal to 75) from a binary file “stud.dat”, assuming the binary file is containing the objects of the following class:
class student
{
int rno;
char sname [20];
int percent;
public:
int retpercent()
{
return percent;
}
void getdetails()
{
cin>>rno;
gets(sname);
cin>>percent;
}
void showdetails()
{
cout<<rno;
puts(sname);
cout<<percent;
}
};