TCS
Company
Logical Reasoning
Blood Relations
If f(0)=1 and f(n)= f(n-1)*n, find the value of f(4).
Read Solution (Total 3)
-
- f(0)=1
since f(n)=f(n-1)*n
so f(1)=f(0)*1=1*1=1
f(2)=f(1)*2=1*2=2
f(3)=f(2)*3=2*3=6
f(4)=f(3)*4=6*4=24...... - 13 years agoHelpfull: Yes(12) No(1)
- f(4)=f(3)*4, f(3)=f(2)*3, f(2)=f(1)*2 ,f(1)=f(0)*1
f(1)=1*1=1, f(2)=1*2, f(3)=1*2*3, f(4)=1*2*3*4
therefore, f(4)=24
- 8 years agoHelpfull: Yes(0) No(0)
- f(1) = f(1-1)*1 = f(0)*1 = 1*1 = 1
f(2) = f(2-1)*2 = f(1)*2 = 1*2 = 2
f(3) = f(3-1)*3 = f(2)*3 = 2*3 = 6
f(4) = f(4-1)*4 = f(3)*4 = 6*4 = 24 - 8 years agoHelpfull: Yes(0) No(0)
TCS Other Question