I have written a while loop that is supposed to determine the value of the parameter "n" for "a" to exceed the value 300. I know "n" should be 17, but I'm getting a value of 4 instead. Does anyone see the problem?
The code is as follows:
a = 10;k = 0.5;n = 2;while a < 300 for m = 1:5 a = a + (a*k) + n; end n = n + 1;end
Best Answer