Font size
Worksheetsoperators(part-1)
Total questions: 10
Worksheet time: 7mins
int x = 5;
int y = 6
int z = 50;
System.out.println(x + y + z);
What will be the output?
61
5650
66
x + y + z
What is the output of below code?
int x = 5;
System.out.println(x++);
System.out.println(x);
5
5
6
6
5
6
6
5
What would the new value of A be?
A=1;
a++;
1
2
3
4
What would the new value of A be?
A=1;
A--;
0
1
2
-1
What's the value of below?
int i=5;
System.out.println(i);
System.out.println(++i);
6
7
67
7
8
5
6
Which statement(s) are equivalent to i = i + 1?
i += 1
i++
i -= 1
i--
What does the following code output?
int x = 1;
System.out.println(x++);
1
2
compilation error
runtime error
++ increases the value of a variable by 1
assignment operator
decrement operator
increment operator
sentinel
What would the new value of A be?
A=1;
a++;
1
2
3
4
Which statement(s) are equivalent to i = i + 1?
i += 1
i++
i -= 1
i--
