Sunday, April 13, 2014

Hasil :


Kode Program :

long int faktorial(int z);
long int faktorial(int z)

{
    long int fak;
    if (z<=1)
        return 1;
    else{
        fak=z*faktorial(z-1);
        return fak;
    }
}

main()
{
    int x,y,z;
    long int hasila;
    long int hasilb;
    long int hasilc;
    long int kombinasi;
    long int permutasi;

    system("cls");
    printf("masukkan x = "); scanf("%d",&x);
    printf("masukkan y = "); scanf("%d",&y);
    z=y-x;
    hasila=faktorial(x);
    hasilb=faktorial(y);
    hasilc=faktorial(z);
   // printf("%d   %d    %d \n\n",hasila,hasilb,hasilc);
    kombinasi=hasilb/(hasila*hasilc);
    permutasi=hasilb/hasilc;
    printf("kombinasi = %d \n",kombinasi);
    printf("permutasi = %d ",permutasi);
printf("\n\nDibuat oleh Yozi Alhafiz 1TK");
    getch();
}


13 Apr 2014

1 comments:

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

About Me

My photo
give something memorable

Statistik

104,939