blob: 7ebf8aec9969283843275fe8a31e95d60772e2fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
//Chapter 06: Counting
clc;
clear;
function res=citycal(n) //function definition
i=n
res=1
for i=1:n-1
res=res*i
end
return res
endfunction
num=input("Enter the number of cities:")
result=citycal(num)
mprintf("The number of possible ways to decide the path is %d ",result)
|