Question
class Output {
public static void main(String args[])
{
int a = 1;
int b = 2;
int c;
int d;
c = ++b;
d = a++;
c++;
b++;
++a;
System.out.println(a + " " + b + " " + c);
}
}
What is the output of this program?
class Output {
public static void main(String args[])
{
int a = 1;
int b = 2;
int c;
int d;
c = ++b;
d = a++;
c++;
b++;
++a;
System.out.println(a + " " + b + " " + c);
}
}
Answer: Option D
Was this answer helpful ?
None.
output:
$ javac Output.java
$ java Output
3 4 4
Was this answer helpful ?
More Questions on This Topic :
Question 10.
What is the output of this program?
class bitwi....
Submit Solution