#include<iostream.h>
#include<conio.h>
class student
{
private:
                int rn,s1,s2,s3,s4,s5,tm;
public:
                void input();
                void output();
};
void student::input()
{
                cout<<"Enter Roll Number:- ";
                cin>>rn;
                cout<<"Enter Marks of five subjects:- ";
                cin>>s1>>s2>>s3>>s4>>s5;
}
void student::output()
{
                tm=s1+s2+s3+s4+s5;
                if(tm>=375)
                                {
                                cout<<"Roll No:- "<<rn<<endl;
                                cout<<"Total Marks:- "<<tm<<endl;
                                }
}
void main()
{
                student s;
                clrscr();
                for(int i=0;i<=10;i++)
                                {
                                s.input();
                                s.output();
                                }
                getch();
}

 

Advertisements