int fact(x) { int fact = 1; int i=x; do { fact = fact * i; i--; }while(i>1); return fact; }