+ 1

Plz solve the bug

using namespace std; #include<iostream> class Vehicle{ public: int mileage=30; int cost=500; void put_vehicle_details(){ cout<<"I am a vehicle"; cout<<"\nMileage of vehicle is : "<<mileage; cout<<"\ncost of vehicle is : "<<cost; } }; void Car : public Vehicle { public: string color="black"; int tyres = 4; void show_car_details(){ cout<<"I am car"; cout<<"\nColor of car is : "<<color; cout<<"\nNo of tyres in car are : "<<tyres; } }; int main(){ Car c1; c1.put_vehicle_details(); return 0; } https://code.sololearn.com/c1kG9mxWWPxG/?ref=app

11th Oct 2022, 5:08 PM
Sahil Kshirsagar
Sahil Kshirsagar - avatar
2 odpowiedzi
+ 4
23. class Car : public Vehicle { // debug
11th Oct 2022, 5:51 PM
Solo
Solo - avatar
+ 1
Thanks
11th Oct 2022, 5:53 PM
Sahil Kshirsagar
Sahil Kshirsagar - avatar