Write, edit and run C, C++ and Python programs right here in your browser. It is free, there is nothing to install and no sign-up. Start with the pyramid program below, change it, and press Run.
Loading the editor…
How to use the playground
- Pick a language tab: C, C++, Java or Python.
- Edit the code. Tab indents, and Ctrl + Enter runs the program.
- If your program reads input (
scanf,cinorinput()), type the values in the Input box, one per line. - Press Run. The output, and any compiler or runtime errors, appear underneath.
- Stop ends a program that runs too long, Reset brings back the original code and Copy copies your code.
Good to know
- Python is real Python 3.14 (Pyodide) with the standard library.
- C and C++ use the real Clang compiler (C++17) running inside your browser. The first C or C++ run downloads about 26 MB once; your browser keeps it for next time.
- Java can be edited and copied here, but not run yet. To run it on your computer, install the JDK and use
javacandjava. - Programs stop after 10 seconds or 100,000 characters of output. They cannot use the network or open files.
- Your code never leaves your device: nothing is sent to our server and nothing is stored. See the privacy policy.
- It works best on a computer. The C/C++ compiler needs a lot of memory, so it may not start on some older phones.
Practise with pattern programs
Every pattern article has an Edit & Run button under each program, so you can change the size or the characters and see what happens. Good places to start:
- Star patterns: squares, triangles, rhombuses and arrows.
- Number patterns: number triangles, squares and diamonds.
- Pyramid patterns: full, hollow and inverted pyramids and the diamond.
- Tricky patterns: when you are ready for a challenge.
