Showing posts with label factorial. Show all posts
Showing posts with label factorial. Show all posts

Tuesday, June 16, 2020

Factorial of a number using recursion in C++

#include<iostream> 

using namespace std;

int factorial (int a){

if(a > 1){
return a * factorial(a-1);
}
else
return 1;
}

int main(){
  int n;
  cin>>n;
  cout<<"The factorial of "<<n<<" is "<<factorial(n);
}

US Government Bans Claude Fable 5 & Mythos 5: Everything You Need to Know

US Government Bans Claude Fable 5 & Mythos 5: Everything You Need to Know June 13, 2026 Last Updated: Ju...

horizontal ads