Invesco interview question

OOPS,Arrays,Java Basics,Factorial program