summaryrefslogtreecommitdiff
path: root/37/CH3/EX3.1/s1.sci
blob: f1d6b6d300d63907290812df7536d14daed44343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Multiplication of 2 numbers
funcprot(0)
function[val]=mul(a,b)
  if(b==1)
    val=a;
  else
    val=a+mul(a,b-1);
  end
endfunction
//Calling Routine:
a=4;
b=3;
val=mul(4,3)
printf("Product of %d and %d is %d",a,b,val);