Selasa, 05 April 2016
Kasus 5.5 - Alpro
Dev c++ 5.5
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
void factorial (int n, int x, int hasil){
if(x>n)
{
cout<<"Factorial "<<n<<" adalah "<<hasil<<endl; }
else
{
hasil=hasil*x;
x=x+1;
factorial(n,x,hasil);
}
}
int main(int argc, char** argv) {
int hasil;
int n;
int x;
cout<<"Masukkan nilai factorial : ";
cin>>n;
x=1;
hasil=1;
factorial(n,x,hasil);
return 0;
}
Langganan:
Posting Komentar (Atom)
Translate
Popular Posts
Postingan Populer
Label
- Alpro (6)
- Dapodik (1)
- Guru (1)
- Kepegawaian (1)
- Kurikulum merdeka (2)
- Literasi digital (2)
- matrik (1)
- Tendik (1)
Arsip Blog
-
▼
2016
(69)
-
▼
April
(35)
- PROBLEM SOLVING 538
- 4.5.1-4.5.3 HOW TO SOLVE
- 4.6 HOW TO SOLVE
- 4.4 HOW TO SOLVE
- 4.3 HOW TO SOLVE
- 4.2 HOW TO SOLVE
- 4.1 HOW TO SOLVE
- BAB 10
- BAB 9
- BAB 8
- BAB 7
- BAB 3
- BAB 2
- BAB 1 (Diktat)
- BAB 6B (Diktat)
- BAB 6A (Diktat)
- BAB 5 (Diktat)
- BAB 4 (Diktat)
- Kasus 5.8 - Alpro
- Kasus 5.6 - Alpro
- Kasus 5.5 - Alpro
- Kasus 5.4 - Alpro
- Kasus 5.3 - Alpro
- Kasus 5.2 - Alpro
- Kasus 3.5 - Alpro
- Kasus 3.4 - Alpro
- Kasus 3.3 - Alpro
- Kasus 3.2 - Alpro
- Kasus 3.1 - Alpro
- Kasus 2.6 - Alpro
- Kasus 2.3 - Alpro
- Kasus 2.2 - Alpro
- Kasus 4.8 - Alpro
- REFLEKSI MINGGU KE-2
- REFLEKSI MINGGU KE-1
-
▼
April
(35)


Tidak ada komentar:
Posting Komentar