class stu{
char g,name[45],course[10],sem[10],ses[9],sub[5][10];
int roll;
float marks[5],t,p;
}s[10];
#include<iostream.h>
#include<conio.h>
void main()
{
int i=0,j=0;
while(j!=10)
{
cout<<"Enter details of student "<<j<<":"<<endl;
cout<<"Enter name:"
cin>>s[j].name;
cout<<"Enter roll number:";
cin>>roll;
cout<<"Enter course:";
cin>>s[j].course;
cout<<"Enter session:";
cin>>ses;
cout<<"Enter semester:";
cin>>sem;
cout<<"Enter subjects:"
while(i!=5)
{
cout<<"Enter subject "<<i-1<<':';
cin>>s[j].sub[i];
cout<<"Enter marks obtained:";
cin>>s[j].marks[i];
s[j].t=s[j].t+s[j].marks[i];
i++;
}
s[j].p=s[j].t/5;
j++;
}
i=j=0;
while(j!=0)
{
clrscr();
cout<<"\t\t Marks Details\n";
cout<<"Course: "<<s[j].course<<"\t\tSemester: "<<s[j].sem;
cout<<"\nRoll: "<<s[j].roll<<"\t\tSession: "<<s[j].ses;
cout<<"\nName: "<<s[j].name<<"\nSubjects: ";
while(i!=5)
{
cout<<s[j].sub[i]<<" ";
i++;
}
cout<<'|'<<s[j].sub[0]<<'|'<<s[j].sub[1]<<'|'<<s[j].sub[2]<<'|'<<s[j].sub[3]<<'|'<<s[j].sub[4]<<endl;
cout<<'|'<<s[j].marks[0]<<'|'<<s[j].marks[1]<<'|'<<s[j].marks[2]<<'|'<<s[j].marks[3]<<'|'<<s[j].marks[4]<<endl;
cout<<"\nTotal: "<<s[j].t<<"\t\t Percentage: "<<s[j].p;
cout<<"\tGrade: "<<s[j].g;
j++;
}
}
No comments:
Post a Comment