0
how to display output as our name
2 Answers
+ 2
{ string name;
cout<<"enter ur name"<<endl;
cin>>name;
cout<<"Hello "<<name<<endl;
}
+ 1
class name
{
char *a;
int size;
public:
name()
{
size=10;
a=new int(size);
}
void get()
{
cout<<"enter name:"<<endl;
cin>>name;
}
void display()
{
cout<<name;
}
};
int main()
{
name n;
n.get();
n.display();
return 0;
}