Ask Question
22 July, 05:41

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; }

+5
Answers (1)
  1. 22 July, 07:37
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers