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

 Respuesta aceptada

KSSV
KSSV el 7 de Abr. de 2020
Editada: darova el 7 de Abr. de 2020

0 votos

i = 1 ;
f = 1 ;
n = 3 ;
while i<=n
f=f*i;
i = i+1 ;
end

6 comentarios

Mohammed Bokhow
Mohammed Bokhow el 7 de Abr. de 2020
Sir KSSV You didn't answer me correctly
Mohammed Bokhow
Mohammed Bokhow el 7 de Abr. de 2020
did you read my qusetion carefully?
Mohammed Bokhow
Mohammed Bokhow el 7 de Abr. de 2020
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
Mohammed Bokhow
Mohammed Bokhow el 7 de Abr. de 2020
this was my question
KSSV
KSSV el 7 de Abr. de 2020
I gave you the answer.......you need to change the variables accoridng to yours thats it...
Mohammed Bokhow
Mohammed Bokhow el 7 de Abr. de 2020
ok how can i change them i'm bignner at using matlab

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 7 de Abr. de 2020

Editada:

el 7 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by