Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
Python
JavaScript
Java
C++
a = 2 b = 3 print('a is ' + str(a) + ', and b is ' + str(b)) c = a + b print('The sum a + b is ' + str(c)) #Python
const a = 2; const b = 3; console.log('a is ' + a + ', and b is ' + b); const c = a + b; console.log('The sum a + b is ' + c); //JavaScript
public class Main { public static void main(String[] args) { int a = 2; int b = 3; System.out.println("a is " + a + ", and b is " + b); int c = a + b; System.out.println("The sum a + b is " + c); } } //Java
#include
#include
using namespace std; int main() { int a = 2; int b = 3; int c = a + b; cout << "The sum a + b is " + to_string(c); return 0; } //C++
Python result:
JavaScript result:
Java result:
CPP result:
a is 2, and b is 3
The sum a + b is 5
a is 2, and b is 3
The sum a + b is 5
a is 2, and b is 3
The sum a + b is 5
a is 2, and b is 3
The sum a + b is 5