#include<iostream.h>
#include<conio.h>
#include<string.h>
class student
{
int roll;
char name[20];
public:
student(){};
student(int r,char n[])
{
roll=r;
strcpy(name,n);
}
void show()
{
cout<<"\nRoll number:"<<roll;
cout<<"\nName:"<<name;
}
};
void main()
{
student s,s1(18,"Mayur");
clrscr();
s.show();
s1.show();
getch();
}
No comments:
Post a Comment