Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "=== Menghitung Faktorial C++ ===" << endl;
- int faktorial, i;
- cout << endl;
- cout << "Masukkan angka : ";
- cin >> faktorial;
- int hitung = 1;
- for(i=1;i<=faktorial;i++) {
- hitung = hitung * i;
- }
- cout << faktorial << "! = " << hitung;
- cout << endl;
- }
Add Comment
Please, Sign In to add comment