Find Here !!!

Tuesday, 18 March 2014

Contoh Program C++ untuk menghitung Faktorial

Faktorial

______________________________________________________
#include<iostream.h>

#include<conio.h>
void main()
{
 int x,y;
 long int jumlah=1;
 cout<<"input angka : ";cin>>x;
 cout<<x<<"!=";
 for(y=x;y>=1;y--)
 {

 jumlah=jumlah*y;
  cout<<y<<"x";
 }
 cout<<"\b="<<jumlah;
}

________________________________________________________________

  Semoga Berguna ^,^

No comments:

Post a Comment