#include <iostream>
#include <string.h>
using namespace std;
class Student
{
char stuname[20];
public:
Student()
{
cout<<"No Attendance";
}
Student(char name[])
{
strcpy(stuname,name);
}
void display()
{
cout<<"\nHello "<<stuname<<endl;
}
};
int main()
{
Student stdabs;
char new_name[20];
cin>>new_name;
Student stdpst(new_name);
stdpst.display();
return 0;
}
#include <string.h>
using namespace std;
class Student
{
char stuname[20];
public:
Student()
{
cout<<"No Attendance";
}
Student(char name[])
{
strcpy(stuname,name);
}
void display()
{
cout<<"\nHello "<<stuname<<endl;
}
};
int main()
{
Student stdabs;
char new_name[20];
cin>>new_name;
Student stdpst(new_name);
stdpst.display();
return 0;
}
testcase 8 failed
ReplyDeletetest case 8 failed .not working bro pls help.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteSimply replace the string variable "new_name" in main function with "name".
ReplyDeleteIt will work with 100% success.
It works thanks
DeleteThanx
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete