How to use While loop
7 次查看(过去 30 天)
显示 更早的评论
I have this problem "Suppose you start multiplying the numbers 1.1, 1.2, 1.3, 1.4,1.5, ... together. Use a while loop to determine how many of these numbers you have to multiply in this way to get a product that is greater than 100000." This is the code I have so far but the answer was wrong. I know that there's something wrong with the line y=y*(y+0.1) but I don't know how to express the multiplication of 1.1*1.2*1.3 and so on. Could you please help me with this?
This is my code
y = 1.1;
c = 0;
while y < 100000
y = y*(y+0.1);
c = c+1;
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!