Factorial without the use of command.

function y = fact(x)
y = x;
while x
end

2 Comments

@Mubarak Abdulla: this is not twitter, so do not put ugly and pointless # characters onto every tag. Today I changed them for you, but in future you can remember that the entire world does not consist of twitter.

Sign in to comment.

Answers (1)

N = 5 ;
f = 1 ;
for i = 1:N
f = f*i ;
end

Categories

Find more on App Building in Help Center and File Exchange

Asked:

on 12 Sep 2017

Commented:

on 12 Sep 2017

Community Treasure Hunt

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

Start Hunting!