hi,

Your program asking 2 inputs but you given only one input that is the problem.:)>-

Please remove the below line of code, then try to run it will run.

int num = input.nextInt();...