#include<iostream.h>
#include<stdio.h>
#include<conio.h>
class student
{
private:
int age;
char name[10];
public:
void getdata()
{
cin>>name;
cin>>age;
}
void putdata()
{
cout<<"Your name is "<<name;
cout<<"Your age is "<<age;
}
};
void main()
{
student st;
st.getdata();
st.putdata();
clrscr();
getch();
}
#include<stdio.h>
#include<conio.h>
class student
{
private:
int age;
char name[10];
public:
void getdata()
{
cin>>name;
cin>>age;
}
void putdata()
{
cout<<"Your name is "<<name;
cout<<"Your age is "<<age;
}
};
void main()
{
student st;
st.getdata();
st.putdata();
clrscr();
getch();
}
0 comments:
Post a Comment