calculation of factorial using gui