If the statement number1++ is changed to ++number1


number1 = 0; 
number2 = 0; 
while(number1 < 5) 
number1 ++; 
number2 += number1;

Question#1 : what is the value of number1 when the loop exits?
Question#2 : what is the value of number2 when the loop exits?
Question#3 : if the statement number1++ is changed to ++number1, what is the value of number1 when the loop exits?
Question#4 : what could you do to force the value of number2 to be 15 when the loop exits?

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: If the statement number1++ is changed to ++number1
Reference No:- TGS085465

Expected delivery within 24 Hours