Factorial program in java using scanner