As2771 / Hacktoberfest-2k18

This repository is bascially for those who want to fresh start their open source journey or want to contribute for hacktoberfest 2k18
2 stars 40 forks source link

Merge pull request #32 from As2771/As2771-patch-5 #34

Open jhhlim opened 6 years ago

jhhlim commented 6 years ago

include

using namespace std;

int factorial(int);

int main() { int x, fact; cout<<"Enter number : "; cin>>x; //input fact =factorial(x); cout<<"Factorial: :"<<fact;

return 0;

}

int factorial(int x) { int fact=1;

while(x>=1)
{
    fact=fact*x;
    x--;
}

return fact;

}