#include<iostream.h>
#include<conio.h>
struct test
{
int roll_no;
char name[10];
int sub[3];
};
void main()
{
clrscr();
int sum=0;
struct test r;
cout<<"enter any name=";
cin>>r.name;
cout<<"enter roll number";
cin>>r.roll_no;
for(i=0;i<3;i++)
{
cout<<"enter the marks";
cin>>r.sub[i];
cout<<"\n";
sum=sum+r.sub[i];
}
cout<<sum;
getch();
}
No comments:
Post a Comment