class_cpp

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; class Arithmetic { private: int a; int b; public: Arithmetic(int alfa, int bravo) { this -> a = alfa; this -> b = bravo; } int add() { int c; c = a + b; return c; } int sub() { int c; c = a - b; return c; } }; int main() { Arithmetic ar(10, 5); cout << "add = " << ar.add() <<endl; cout << "sub = " << ar.sub() << endl; return 0; }
#include <iostream> using namespace std; int fun2(int n) { if(n > 0) { fun2(n - 1); cout << n << endl; } }; int main() { int x = 3; fun2(x); }
Editor Settings
Theme
Key bindings
Full width
Lines