Log in
Sign up for FREE
arrow_back
Library
Math Test
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
7 questions
Add this activity
1
1
1
1
1
1
1
Question 1
1.
What is output by the code below?
double x = .5 + .5;
System.out.print(x);
0
1
0.0
1.0
2
Question 2
2.
What is output by the code below?
int x = 1;
x *= 5;
System.out.print(x);
0
1
2
3
5
Question 3
3.
What is output by the code below?
System.out.print( 4 - 3 );
-1
1
4
0
3
Question 4
4.
What is output by the code below?
System.out.print(4 % 3);
.5
1
2
0
3
Question 5
5.
What is output by the code below?
System.out.print( (int)9.6 );
10
6
9.0
9.6
9
Question 6
6.
What is output by the code below?
int x = 12,
y = 20;
int z = x + y;
double a = z;
System.out.print(a);
32.0
50
42
17.0
32
Question 7
7.
What is output by the code below?
System.out.println( 7 / 0);
0
7
0.7
27
There is no output due to a runtime error.