Question
class increment {
public static void main(String args[])
{
double var1 = 1 + 5;
double var2 = var1 / 4;
int var3 = 1 + 5;
int var4 = var3 / 4;
System.out.print(var2 + " " + var4);
}
}
What is the output of this program?
class increment {
public static void main(String args[])
{
double var1 = 1 + 5;
double var2 = var1 / 4;
int var3 = 1 + 5;
int var4 = var3 / 4;
System.out.print(var2 + " " + var4);
}
}
Answer: Option C
None
output:
$ javac increment.java
$ java increment
1.5 1
Was this answer helpful ?
None
output:
$ javac increment.java
$ java increment
1.5 1
Was this answer helpful ?
More Questions on This Topic :
Question 1.
Which of these statements are incorrect?
....
Question 2.
Which of these statements are incorrect?
....
Question 5.
Which of these statements are incorrect?
....
Submit Solution