Question: I need someone help with very basic stuff! Please have explaination too! int b=5; int ans=0; while (b <11){ b=b+2; ans=ans+b; } System. out .println(ans);
I need someone help with very basic stuff! Please have explaination too!
int b=5;
int ans=0;
while (b<11){
b=b+2;
ans=ans+b;
}
System.out.println(ans);
question 1: How many times the body of the while loops is executed?
question 2: What are the values of 'b' and 'ans' at the end of each loop iteration.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
