43.1k views
0 votes
How many times will the while loop that follows be executed? var months = 5; var i = 1; while (i < months) { futureValue = futureValue * (1 + monthlyInterestRate); i = i+1; }

1 Answer

2 votes

Answer:

4 times

Step-by-step explanation:

It will be executed for values 1,2,3 and 4 for i.

User Ivan Ignatiev
by
4.9k points