Ask Question
13 September, 07:14

Write a function file that accepts the values of r, a and n as arguments and uses a for loop to return the sum of the first n terms of the geometric series. test your function for a = 3, r = 1/2 and n = 10.

+5
Answers (1)
  1. 13 September, 08:57
    0
    Given, a = 3, r = 1/2, n = 10

    %r is common ratio

    %n is number of terms

    %a is the first term of the series

    Sum = 0;

    a = 3;

    r = 1/2;

    for i = 0 : 1 : 10;

    Sum = Sum + a * r ^ i;

    end

    Sum
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a function file that accepts the values of r, a and n as arguments and uses a for loop to return the sum of the first n terms of the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers