Use a while loop to calculate f=10!. Display only the final value using the function "disp"

댓글 수: 2

James Tursa
James Tursa 2021년 2월 20일
What have you done so far? What specific problems are you having with your code?
I figured it out! Thanks though!

댓글을 달려면 로그인하십시오.

 채택된 답변

Kate Heidingsfelder
Kate Heidingsfelder 2021년 2월 20일

0 개 추천

kk = 10;
k = 1;
f = 1;
while k <= kk
f = k * f;
k = k + 1;
end
format long
disp(f)

추가 답변 (2개)

Anusha
Anusha 2023년 10월 25일

0 개 추천

kk = 10;
k = 1;
f = 1;
while k <= kk
f = k * f;
k = k + 1;
end
format long
disp(f)
Anusha
Anusha 2023년 10월 25일

0 개 추천

kk = 10;
k = 1;
f = 1;
while k <= kk
f = k * f;
k = k + 1;
end
format long
disp(f)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 2월 20일

답변:

2023년 10월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by