.
Home About-us Privacy Policy Contact-us Services

Monday, October 5, 2015

Program to Find the Factorial Number in c++

ad+1

 Factorial number is multiply the own back number Like if number is 5 then =5*4*3*2*1 =120

/*Program to find factorial of a number*/


#include<iostream.h>
#include<conio.h>
void main()
{
int j,n,fact=1;
clrscr();
cout<<"\n enter the number: ";
cin>>n;
for(j=1;j<=n;j++)
fact=fact*j;
cout<<"factorial of"<<n<<"="<<fact;
getch();
}

 Output:


    enter the number:7
     factorial of 7=5040



0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates