Code examples
Runnable examples for every language — open them in the playground and modify.
Server-side code execution is not enabled on this server. The web (HTML/CSS/JS) playground always works.
HTML · CSS · JavaScript
<h1 id="t">Hello</h1>
<script>
document.getElementById('t').textContent = 'হ্যালো, WAN!';
</script>
Open in playground
C (GCC 14)
#include <stdio.h>
int main(void) {
printf("Hello, C!\n");
return 0;
}
Open in playground
C++ (GCC 14)
#include <iostream>
int main() {
std::cout << "Hello, C++!" << std::endl;
}
Open in playground
Java 21
public class Main {
public static void main(String[] args) {
System.out.println("Hello from Java 21");
}
}
Open in playground
JavaScript (Node.js 22)
const nums = [1, 2, 3, 4, 5];
console.log('Sum:', nums.reduce((a, b) => a + b, 0));
Open in playground
Python 3.12
name = input() if False else 'WAN'
print(f'Hello, {name}!')
print(sum(range(1, 11)))
Open in playground