Q. What is the output of this program?

Code:
public class Result 
{
        public static void main(String args[]) 
        {    
             int p,q,r,s;
             p=q=r=s=10;
            p+=q-=r*=s/=10;
           System.out.println(p+" "+q+" "+r+" "+s);
 
        } 
}
  • (A) 20 0 20 1
  • (B) 10 0 10 1
  • (C) 10 0 0 10
  • (D) 20 0 0 20
πŸ’¬ Discuss
βœ… Correct Answer: (B) 10 0 10 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
269
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Prabhas Kapoor
Publisher
πŸ“ˆ
91%
Success Rate