#include<iostream>
using namespace std;
class student
{
int res,id;
public:
void getdata(int sid,int sres)
{
    id=sid;
    res=sres;
}
void display()
{
    cout<<"the id is"<<id<<"the result is"<<res<<endl;
}
};
int main()
{
    int sres,sid,i,pass=0,fail=0,n;
    student a[10];
    cout<<"enter the number of students"<<endl;
    cin>>n;
    for(i=0;i<n;i++)
        { 
            cout<<"enter the sid" <<endl;
            cin>>sid;
            cout<<"enter 1 for pass and 0 for fail" <<endl;
            cin>>sres;
            if(sres==1)
            {
                pass++;
            }
            else 
            {
                fail++;
            }
         a[i].getdata(sid,sres);
      }
    for(i=0;i<n;i++)
        {
            a[i].display();
        }
    cout<<"the number of pass students are "<<pass;
    cout<<"the number of fail students are"<<fail;
    if(pass>=8)
    {
        cout<<"tution raised !"<<endl;
    }
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: