{ }

C++ Runner

Run C++ line by line — arrays, vectors, functions, recursion, STL & cin — with a live call stack, variables, and output.

source — editable
execution — current line highlighted
1#include <iostream>
2using namespace std;
3
4int main() {
5 int a = 12, b = 5;
6 cout << "sum = " << a + b << endl;
7 cout << "diff = " << a - b << endl;
8 cout << "prod = " << a * b << endl;
9 cout << "quot = " << a / b << endl;
10 cout << "rem = " << a % b << endl;
11 return 0;
12}
program input (cin) — whitespace separated
call stack & variables
frame 0<globals>()
no locals yet
Program start
stdout (cout)
▌
Speed55
1 / 9

Teaching interpreter for a large subset of C++: variables, arithmetic/bitwise/logical/ternary operators, if/else, for/while/do-while, switch, break/continue, arrays (incl. 2D), std::vector, std::string methods, functions & recursion (with call stack), cin, and STL helpers (sort, reverse, min, max, swap, abs, sqrt, pow, gcd…). Not yet supported: classes/structs, maps/sets, pointers, and new/delete.