cara jitu
Thursday, November 29, 2012
Cara Membuat Faktorial
#include<iostream.h>
#include<conio.h>
void main()
{
int bil, n;
long int hasil;
cout<<"n = ";
cin>> n;
hasil=1;
for(bil=n; bil>=1;bil--)
{
hasil=hasil*bil;
}
cout<<"n!= "<<hasil<<"\n";
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment