You are viewing a single comment's thread. Return to all comments →
using namespace std;
class Student { private: int age; int standard; string first_name; string last_name;
public: void input() { cin >> age >> first_name >> last_name >> standard; }
void answer() { cout<<age<<endl; cout<<last_name<<", "<<first_name<<endl; cout<<standard<<endl<<endl; cout << age << "," << first_name << "," << last_name << "," << standard; }
};
int main() { Student st; st.input(); st.answer(); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Class
You are viewing a single comment's thread. Return to all comments →
include
include
using namespace std;
class Student { private: int age; int standard; string first_name; string last_name;
public: void input() { cin >> age >> first_name >> last_name >> standard; }
};
int main() { Student st; st.input(); st.answer(); return 0; }