online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; class fruit { public: int apples = 0, mangoes = 0; int total_fruits = 0; void input_fruits() { cout << "Enter the number of apples : "; cin >> apples; cout << "Enter the number of mangoes : "; cin >> mangoes; } void calculate_total() { total_fruits = apples + mangoes; cout << "The total fruits in the basket are : " << total_fruits << endl; } }; class apple : public fruit { public: void show_apples() { cout << "The number of apples in the basket is : " << apples << endl; } }; class mango : public fruit { public: void show_mangoes() { cout << "The number of mangoes in the basket is : " << mangoes << endl; } }; int main() { apple a1; mango m1; a1.input_fruits(); a1.show_apples(); m1.input_fruits(); //added this m1.show_mangoes(); a1.calculate_total(); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue