Tugas DDP Functions

#include <cstdlib>
#include <iostream>
using namespace std;

int factorial(int f){
    int hasil=1;
   
    for(int i=1; i<=f; i++){
            hasil*=i;
            }
    return hasil;
            }
   

int main(int argc, char *argv[]){
    int x;
   
    cout<<"Masukan bilangan yang akan di factorial : ";
    cin>>x;
    cout<<x<<"! = "<<factorial(x)<<endl;

    system("PAUSE");
    return EXIT_SUCCESS;}
First