Objectiu
1
(a) 10,10
(a) 5.0
1. Multiple Choice Questions (Tick the correct answers):
1. The statement n += 4 is equivalent to:
(b) n=n+4
(c) n+1
(d) none
What will be the output of 3' and 'b' in the following if int a, b; a=10; b=a++;?
(b) 10,11
(c) 11,10
(d) 11,11
3. What will be the output of a++ if int a = -1;?
(b) - 1
(c) o
(d) none
4. If int a=25, b=5,c=0; what value is stored in c when c = a%b;?
(b) 5
(c) O
(d) none
5. What is the result of the following statement in Java: When int m=8; m*=8; System.
println(“The output ="+m);?
(b) 64
(c) 16
(d) 88
6. double c;int x,y,z; x=5;y=10;z=11; c=x*y+z/2; The value stored in c is:
(b) 55.5
(c) 55
(d) none
7. int m,p;m=5;p=0; p= m - - + -- m; The output will be:
(b) 10
(c) 8
(d) 12
8. int a=7, p=0, q=0; p= + + a + -- a; 9 - = p; The output of q will be:
(b) 14
(c) 15
(d) -15
(a) 8
(a) 55.0
(a) 11
(a) 13
Answers
Answer:
Objectiu
1
(a) 10,10
(a) 5.0
1. Multiple Choice Questions (Tick the correct answers):
1. The statement n += 4 is equivalent to:
(b) n=n+4
(c) n+1
(d) none
What will be the output of 3' and 'b' in the following if int a, b; a=10; b=a++;?
(b) 10,11
(c) 11,10
(d) 11,11
3. What will be the output of a++ if int a = -1;?
(b) - 1
(c) o
(d) none
4. If int a=25, b=5,c=0; what value is stored in c when c = a%b;?
(b) 5
(c) O
(d) none
5. What is the result of the following statement in Java: When int m=8; m*=8; System.
println(“The output ="+m);?
(b) 64
(c) 16
(d) 88
6. double c;int x,y,z; x=5;y=10;z=11; c=x*y+z/2; The value stored in c is:
(b) 55.5
(c) 55
(d) none
7. int m,p;m=5;p=0; p= m - - + -- m; The output will be:
(b) 10
(c) 8
(d) 12
8. int a=7, p=0, q=0; p= + + a + -- a; 9 - = p; The output of q will be:
(b) 14
(c) 15
(d) -15
(a) 8
(a) 55.0
(a) 11