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