Welcome to Westonci.ca, the place where your questions find answers from a community of knowledgeable experts. Our platform provides a seamless experience for finding precise answers from a network of experienced professionals. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

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