Sabtu, 17 April 2010

Cpp for

#include

int main(){

int fak = 5;
int i;
int hasil = 1;

for(i=2; i<=fak;i++){
hasil = hasil * i;
printf("nilai variabel penghitung : %d\n", i);
}

printf("hasil faktorial : %d\n", hasil);

return 0;

}