thumbnail

Programming Languages - "1+2=3"

Can you identify these programming languages based on a code snippet that sets two variables to 1 and 2, adds them together and prints out the text "1+2=3"?
Answers must correspond to the highlighted box
Since punctuation characters are ignored by JetPunk, type the languages' names according to how you read them (for example if C# were here you would type "C sharp")
Quiz idea: alexm72
Quiz by akjlddkjslfsd
Rate:
Last updated: July 2, 2022
You have not attempted this quiz yet.
First submittedJuly 2, 2022
Times taken90
Average score60.0%
Report this quizReport
4:00
Enter answer here
0
 / 10 guessed
The quiz is paused. You have remaining.
Scoring
You scored / = %
This beats or equals % of test takers also scored 100%
The average score is
Your high score is
Your fastest time is
Keep scrolling down for answers and more stats ...
Code
Language
int a = 1;
int b = 2;
int c = a + b;
System.out.printf("%d+%d=%d\n", a, b, c);
Java
var a = 1, b = 2;
var c = a + b;
console.log(a + "+" + b + "=" + c);
JavaScript
$a = 1
$b = 2
$c = $a + $b
echo "$a+$b=$c"
PHP
int a = 1, b = 2;
int c = a + b;
cout << a << '+' << b << '=' << c << endl;
C++
var a = 1
var b = 2
var c = a + b
print("\(a)+\(b)=\(c)")
Swift
a = 1
b = 2
c = a + b
print(a, "+", b, "=", c, sep="")
Python
int a = 1, b = 2;
int c = a + b;
printf("%d+%d=%d\n", a, b, c);
C
a = 1, b = 2
c = a + b
fmt.Printf("%d+%d=%d\n", a, b, c)
Go
Dim a As Integer = 1
Dim b As Integer = 2
Dim c As Integer = a + b
Console.WriteLine("{0}+{0}={0}", a, b, c)
Visual Basic
a = 1
b = 2
c = a + b
puts "#{a}+#{b}=#{c}"
Ruby
No comments yet