Ask Question

What will futureValue contain after the for loop has been executed one time? var years = 10; var annualRate = 10; var futureValue = 1000; annualRate = annualRate / 100; for (i = 1; i < = years; i++) { futureValue + = futureValue * annualRate; }

+2
Answers (1)
  1. 25 April, 00:59
    0
    One time executed for loop value is "1100".

    Explanation:

    In the given jа vascript program, three variable "years, annualRate and futureValue is declare, in which all variable assign a value, that is "10, 10, and 1000".

    In the next step, a variable annualRate divides its value by 100 so, it will give "0.1", then a for loop is declare, that uses variable i, which starts from 1 and ends when the value of i is less than equal to years variable, but in this program, there is no need of loop. Inside the loop, the future variable calculates the value and to print its value there we use print method to print its value, that is equal to "1100".
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What will futureValue contain after the for loop has been executed one time? var years = 10; var annualRate = 10; var futureValue = 1000; ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers