This code snippet is intended to calculate the balance of an account after twenty years of gaining interest. Select the statement that correctly completes the loop.

int years = 20;
double balance = 10000;
while (years > 0)
{
__________
double interest = balance * rate / 100;
balance = balance + interest;
}

Respuesta :

Answer:

The answer to this question is the "years--;".

Explanation:

In the given question code the if we define the years--; and the rate of interest in the code so this program will return a value for example if we give rate of interest or rate to value 5 then the output of the code is 26532.977051  because it returns the double that is a floating-point value.  So the missing code for this question is "years--;".

 

Q&A Education