Can you help me fix this java error in program?[Solved] | SoloLearn: Learn to code for FREE!

+1

Can you help me fix this java error in program?[Solved]

https://code.sololearn.com/cOnWqjr4pNn0/?ref=app

3/3/2021 8:25:11 AM

It's Roy

2 Answers

New Answer

+4

You can use a new line instead of adding prompt message in Scanner object. Scanner sc = new Scanner(System.in); System. out.println("Enter a no"); int n = sc.nextInt();

+2

Simba Thank you very much :-)