for(k=1;k<=2;k++)
{ for(m=1;m<=4;m++)
{ System.out.println(m*2);
}
}
How many times the inner loop is executed?
  1. 4 times
  2. 8 times
  3. 2 times
  4. 16 times


Solution



(b)
8 times

Explanation:

The more the number of times the outer loop will run,that many times the inner loop will run,so outer loop is running 2times and inner loop is running 4 times

So total execution of inner loop is 8times


Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com