C++ Programming How to find Factorial using Functions
This Program will show how to find a factorial of any number using Function
Note : You can use any integer number in the code. I just use 5 .
Program # 5 : Factorial using Function :
#include <iostream>using namespace std;int factFinder(int x){if(x==0){return 1;}else{return x*factFinder(x-1);}}int main(){cout << factFinder(5) << endl;}
Note : You can use any integer number in the code. I just use 5 .
Post a Comment
Please Don't Spam You are allowed to comment your website link