0

How can I do this code ?

Using recursion function prints the factorial of numbers between 1-100

14th Sep 2020, 5:56 PM
WAZIR KHALED
WAZIR KHALED - avatar
6 Answers
+ 2
What you mean by who can do this ? We don't code for you if that's what you are asking for ,a little better question would be "how can I solve it ,I have been trying for so and so hours ,searching everywhere but can't seem to understand how recursion works " Also link the code you have tried so far so people can assist you further
14th Sep 2020, 6:05 PM
Abhay
Abhay - avatar
+ 1
#include <iostream.h> long long f(long long x){ if(x==1||x==0) return 1; else return x*f(x-1);} int main(){ for(long long i=2;i<22;i++) { cout<<f(i)<<endl;} }
14th Sep 2020, 6:07 PM
WAZIR KHALED
WAZIR KHALED - avatar
+ 1
This is my code But the teacher said he wants the code without using loop
14th Sep 2020, 6:08 PM
WAZIR KHALED
WAZIR KHALED - avatar
0
This is for one number I want for numbers 1 to 100
14th Sep 2020, 6:28 PM
WAZIR KHALED
WAZIR KHALED - avatar