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

Code:
class jump_statments 
{
    public static void main(String args[]) 
    {        
         int x = 2;
         int y = 0;
         for ( ; y < 10; ++y) 
         {
             if (y % x == 0) 
                 continue;  
             else if (y == 8)
                  break;
             else
                System.out.print(y + " ");
         }
    } 
}
  • (A) 1 3 5 7
  • (B) 2 4 6 8
  • (C) 1 3 5 7 9
  • (D) 1 2 3 4 5 6 7 8 9
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1 3 5 7 9

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
169
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
81%
Success Rate