Discover answers to your most pressing questions at Westonci.ca, the ultimate Q&A platform that connects you with expert solutions. Discover the answers you need from a community of experts ready to help you with their knowledge and experience in various fields. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.

What is the output for the following program?
numA = 4
while numA <12:
numA = numA + 3
print(numA)
Output:

Sagot :

Answer:

13

Explanation:

int numA = 4;

whilie (numA < 12){

  numA += 3;

}

System.out.print(numA);

numA          numA < 12

  4                   true ⇒ numA increases by 3, loop continues

  7                   true ⇒ numA increases by 3, loop continues

  10                 true ⇒ numA increases by 3, loop continues

  13                 false ⇒ loop stops, program them prints out value of numA