Infosys interview question

Coding question : Prime no code , factorial etc type.