Wednesday 12 September 2012

Result card

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a[5][7];
char reg[5][20];
int i,j,opt,sum;
float avg;
for(i=0;i<5;i++)
{
sum=0;
avg=0;
cout<<"\nEnter your registration number for student  "<<i+1<<" = ";
cin>>reg[i];
cout<<"\nEnter the marks of your subjects \n ";
for(j=0;j<=4;j++)
{
cout<<"1-pf\t2-itc\t3-english\t4-calculus\t5-islamiyat\n\n";
cout<<"Please enter your chioce = ";
cin>>opt;
if(opt==1)
{
cout<<"Pf = ";
}
if(opt==2)
{
cout<<"ITC = ";
}
if(opt==3)
{
cout<<"english = ";
}
if(opt==4)
{
cout<<"CALCULUS = ";
}
if(opt==5)
{
cout<<"ISLAMIYAT = ";
}
cin>>a[i][j];
sum=sum+a[i][j];
a[i][5]=sum;
}
avg=sum/5;
a[i][6]=avg;
}
cout<<"\nMark sheet of the students";
cout<<"\nRegistration number ";
cout<<"PF\tITC\tCalculus  english  islamiyat  sum  average\n\n";
for(i=0;i<5;i++)
{
cout<<reg[i]<<"\t";
for(j=0;j<=6;j++)
{
cout<<a[i][j]<<" \t";
}
cout<<endl;
}
getch();
}

No comments:

Post a Comment