https://github.com/md-asikuzzaman/cpp-problems
problems solving with c++
https://github.com/md-asikuzzaman/cpp-problems
codeblocks cpp
Last synced: 7 months ago
JSON representation
problems solving with c++
- Host: GitHub
- URL: https://github.com/md-asikuzzaman/cpp-problems
- Owner: Md-Asikuzzaman
- License: mit
- Created: 2024-06-03T05:49:53.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-02T06:00:54.000Z (over 1 year ago)
- Last Synced: 2025-06-10T18:21:54.127Z (8 months ago)
- Topics: codeblocks, cpp
- Language: C++
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## C++ Problems solving...
```
#include
using namespace std;
// Base class Mammals
class Mammals {
public:
void mammalFunction() {
cout << "I am a mammal" << endl;
}
};
// Base class MarineAnimals
class MarineAnimals {
public:
void marineFunction() {
cout << "I am a marine animal" << endl;
}
};
// Derived class BlueWhale
class BlueWhale : public Mammals, public MarineAnimals {
public:
void bothCategories() {
cout << "I belong to both the categories: Mammals as well as Marine Animals" << endl;
}
};
int main() {
// Creating objects for each class
Mammals mammalObj;
MarineAnimals marineObj;
BlueWhale blueWhaleObj;
// Calling functions for each object
mammalObj.mammalFunction();
marineObj.marineFunction();
blueWhaleObj.mammalFunction();
blueWhaleObj.marineFunction();
blueWhaleObj.bothCategories();
return 0;
}
```