#include <iostream>
using namespace std;
struct res
{
    int rn; 
    char name[30];
    int math;
    int hindi;
    int phy;
} ;struct res a[5];
int main() {
    int total,i,avg;
    for (i=0;i<=4;i++)
    {
    cin>>a[i].name;
    cin>>a[i].rn;
    cin>>a[i].math;
    cin>>a[i].hindi;
    cin>>a[i].phy;
    }
    for (i=0;i<=4;i++)
    {
    total=a[i].math+a[i].hindi+a[i].phy;
    avg=total/3;
    cout<<"Name"<<"\t"<<a[i].name<<endl;
    cout<<"Rollno"<<"\t"<<a[i].rn<<endl;
    cout<<"Maths"<<"\t"<<a[i].math<<endl;
    cout<<"Hindi"<<"\t"<<a[i].hindi<<endl;
    cout<<"phy"<<"\t"<<a[i].phy<<endl;
    cout<<"Total Marks"<<total<<endl;
    cout<<"percentage"<<"\t"<<avg<<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: