PROGRAM TO SHOW THE DETAILS OF STUDETS OF CSE CLASS



Hello Friends !!!! Today I am going to tell about the program of array of objects in C++.We make a program to show the details of students of CSE class using array of object in C++.

So here is program=>


//Name : Mayank Sharma
//Roll No : 26
//C.S.E(4th Sem)

// Write a Program To Show the Details of Student of CSE class. //

#include
#include
class stud
{
char name[30];
float age;
public:
void getdata()
{
cout<<"enter name"<<"\n";
cin>>name;
cout<<"age"<<"\n";
cin>>age;
}
void putdata()
{
cout<<"name"< cout<<"age"< }};
const int size=5;
int main()
{
clrscr();
stud s[size];
for(int i=1;i<=size;i++)
{
cout<<"details of Students"<<"\n";
s[i].getdata();
}
cout<<"\n";
for(i=1;i<=size;i++)
{
cout<<"\n student";
s[i].putdata();
}
getch();

}

Output of program :
student 1 :
name
Mayank
age
19
student 2 : name
Kapil
age
19
student 3 : name
Vishal
age
20
student 4 : name
Lalit
age
19
student 5 : name
Kasish
age
19

I think this post will help you.I think this post will help you.
Thanks!!!
If any query about this post then put your comment in comment box below..

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites