Question:What will be the output of the program?
class Test 
{
    public static void main(String [] args) 
    {
        int x= 0;
        int y= 0;
        for (int z = 0; z < 5; z++) 
        {
            if (( ++x > 2 ) && (++y > 2)) 
            {
                x++;
            }
        }
        System.out.println(x + " " + y);
    }
}
 

A 5 2 

B 5 3 

C 6 3 

D 6 4 

+ Answer
+ Explanation
+ Report
Total Preview: 1319

Copyright © 2024. Powered by Intellect Software Ltd