![]() |
Help me
I have written a program for factorial in recursive and i am not able get how the program work.
The program is as follows Code:
#include<iostream.h>enter the no. 3 before m = 3 before m = 2 after m = 2 fact(m-1) = 1 f = 2 before m = 2 after m = 2 fact(m-1) = 1 f = 2 after m = 3 fact(m-1) = 2 f = 6 factorial of the no. is 6 |
Re: Help me
if(m==0|m==1) should be if(m==0||m==1) see the sign of OR its ||
|
| All times are GMT +5.5. The time now is 04:48. |