how can i convert this
n=5;fact = 1 ;
for i = 1:n
fact =fact * i;
end;
disp(fact)
into while loop
with my best regards

 采纳的回答

KSSV
KSSV 2020-4-7
编辑:darova 2020-4-7
i = 1 ;
f = 1 ;
n = 3 ;
while i<=n
f=f*i;
i = i+1 ;
end

6 个评论

Sir KSSV You didn't answer me correctly
did you read my qusetion carefully?
how can i convert this
n=5;fact = 1 ;
for i = 1:n
fact =fact * i;
end;
disp(fact)
into while loop
with my best regards
this was my question
I gave you the answer.......you need to change the variables accoridng to yours thats it...
ok how can i change them i'm bignner at using matlab

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by