Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- class ashik
- {
- int fee;
- char name[10], course[10];
- public:
- ashik(char name[10], char course[10])
- {
- strcpy(this->name , name);
- strcpy(this->course, course);
- fee = 0;
- }
- ashik(char name[10], char course[10], int fee)
- {
- ashik :: ashik(name, course);
- this->fee = fee;
- }
- void display()
- {
- cout << name << endl << course << endl << fee<< endl;
- }
- };
- int main()
- {
- ashik a1("ASHIK", "C++");
- ashik a2("ARISHA", "JAVA", 1000);
- a1.display();
- a2.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement