Search This Blog

Sunday, 23 August 2020

find the factorial ..

 #include<iostream>

using namespace std;

long factorial (int n)

{

int counter;

long fact =1;

for (int i=1;i<=n;i++)

{

fact=fact*i;

}

return fact;

}

int main()

{

int counter,n;

cout<<"ENTER THE NUMBER:\n";

cin>>n;

cout<<n<<" factorial value is : \n"<<factorial(n)<<endl;

cout<<"\n\n\n\n";a

system("pause");

}


No comments:

Post a Comment

Search This Blog

Contact Form

Name

Email *

Message *

Popular Posts