Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
Python
JavaScript
Java
C++
age = 10 print("Age: " + str(age)) if age > 17: print('You are an adult!') else: print('You are not an adult yet.') #Python
const age = 10; console.log("Age: " + age); if (age > 17) { console.log('You are an adult!'); } else { console.log('You are not an adult yet.'); } //JavaScript
public class Main { public static void main(String[] args) { int age = 10; System.out.println("Age: " + age); if (age > 17) { System.out.println("You are an adult!"); } else { System.out.println("You are not an adult yet."); } } } //Java
#include
#include
using namespace std; int main() { int age = 10; cout << "Age: " + to_string(age) + "\n"; if (age > 17) { cout << "You are an adult!"; } else { cout << "You are not an adult yet."; } return 0; } //C++
Python result:
JavaScript result:
Java result:
CPP result:
Age: 10
You are not an adult yet.
Age: 10
You are not an adult yet.
Age: 10
You are not an adult yet.
Age: 10
You are not an adult yet.