Math Test

By Mickey Arnold
Last updated 10 months ago
7 Questions

What is output by the code below?
double x = .5 + .5;
System.out.print(x);

What is output by the code below?
int x = 1;
x *= 5;
System.out.print(x);

What is output by the code below?
System.out.print( 4 - 3 );

What is output by the code below?
System.out.print(4 % 3);

What is output by the code below?
System.out.print( (int)9.6 );

What is output by the code below?
int x = 12,
y = 20;
int z = x + y;
double a = z;
System.out.print(a);

What is output by the code below?
System.out.println( 7 / 0);