LOGO2
 
 
IT Learning

What is the output?
int x = 5;
int y = 7;
int z = x++ + ++y;
System.out.println(z);
12
13
14
15
LOGO2
 
int x = 5;
int y = 10;
int z = x * (y / x) % (y - x);
System.out.println(z);
0
1
5
10
LOGO2
int x = 5;
int y = 10;
double z = (y / x);
System.out.println(z);
2
2.0
2.5
0.5
LOGO2
double x = 2;
int y = 7;
double z=3.5;
z +=y / x;
System.out.println(z);
7.0
7.5
3.5
3.0
 
LOGO2
 
What will be the output of the program?
double x = 2;
int y = 7;
double z =(int)(y / x);
System.out.println(z);
 
3.5
3.0
3
3.2
LOGO2
 
What will be output for the following code?
double x = 3;
int y = 8;
double z=2;
z *=y%x;
System.out.println(z);
1.0
4.0
2.0
2.5
LOGO2

What will be the output of the following program?

double x = 3;
int y = 8;
double z=2;
z =y%x;
System.out.print(z++ +"\t");
System.out.print(++z);
2.0 4.0
2.0 3.0
3.0 3.0
3.0 2.0
LOGO2
static final double pi = 3.14;
public static void main(String[] args) {
Scanner kbd = new Scanner (System.in);
pi=4.5;
System.out.println(pi);
}
3.14
4.5
Compile error
7.64
{"name":"IT Learning", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What is the output? int x = 5; int y = 7; int z = x++ + ++y; System.out.println(z);, int x = 5; int y = 10; int z = x * (y \/ x) % (y - x); System.out.println(z);, int x = 5;int y = 10;double z = (y \/ x);System.out.println(z);","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker