Question
Trace the execution of the following Java code:
  public class Flow {     public static void main(String[] args) {       int count = 0;       for (int i = 0; i < 2; i++) {         for (int j = 0; j < 3; j++) {           count++;         }       }       System.out.println(count);     }   }   What is the output?Solution
The outer loop runs for i = 0 and i = 1 (2 iterations). Â Â The inner loop runs for j = 0, 1, 2 (3 iterations) for *each* iteration of the outer loop. Â Â So, count++ executes 2 * 3 = 6 times. Â Â Initial count = 0. After 6 increments, count = 6.
Which of these is NOT a term used in tennis?
Who has been named as the interim coach for team India in the Asia Cup 2022 ?
Where on a squash court is the 'tin' located?
In which of the following cities has India's first NBA basketball school been started?
Which cup is associated with football?
Who Was the Opponent in the 1983 Cricket World Cup Final Against India?
In the 2024 Paris Olympics, which badminton player did Lakshya Sen defeat to reach the semi-finals, marking a historic first for an Indian male shuttler?
Who emerged victorious at the Monte Carlo Masters 2024, defeating Norway's Casper Ruud in the finals?
What is the edition number of the ICC Women’s T20 World Cup that commenced in Sharjah, UAE?
How many gold medals did India win at the 2024 Asian Athletics Indoor Championships?