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

 Risposta accettata

KSSV
KSSV il 7 Apr 2020
Modificato: darova il 7 Apr 2020
i = 1 ;
f = 1 ;
n = 3 ;
while i<=n
f=f*i;
i = i+1 ;
end

6 Commenti

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
KSSV
KSSV il 7 Apr 2020
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

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by