//WAP to display the static contents of the structure
#include<iostream.h>
#include<conio.h>
//Declaration of Structure
struct
school
{
long int
rollno;
int age;
char
sex;
float
height;
float
weight;
};
void
main()
{
clrscr();
//Static Elements of Structure
school
student={2304,17,'M',157.3,59.8};
cout<<"\nRoll
Number="<<student.rollno<<endl;
cout<<"Age="<<student.age<<endl;
cout<<"Sex="<<student.sex<<endl;
cout<<"Height="<<student.height<<endl;
cout<<"Weight="<<student.weight<<endl;
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.