K

Kiran Rapria • 4.26K Points
Extraordinary

Q. What will be the output of the following Java program?

Code:
class Output 
{
        public static void main(String args[]) 
        {    
             int a,b,c,d;
             a=b=c=d=20;
            a+=b-=c*=d/=20;
           System.out.println(a+" "+b+" "+c+" "+d);
 
        } 
}
  • (A) compile time error
  • (B) runtime error
  • (C) a=20 b=0 c=20 d=1
  • (D) none of the mentioned
  • Correct Answer - Option(C)
  • Views: 15
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics