Oracle interview question

Implementing a factorial function

Interview Answer

Anonymous

Sep 10, 2020

#include using namespace std; int factorial( int n) { if(n == 0 || n == 1) return 1; return n*factorial(n-1); } int main() int n; cout>n; int res = factorial(n); cout<<"factorial of "<