0

When I trying to run a Java program. When this happened ( split multiple inputs into separate lines ). . what will I do to run ?

23rd Aug 2022, 2:07 PM
ASWANTH P
ASWANTH P - avatar
9 odpowiedzi
+ 2
On the pop-up window for input: Give all required inputs by separating line by line ( or space separating if valid).. After hit submit button. For your code , ex: 20 (submit)
23rd Aug 2022, 3:28 PM
Jayakrishna 🇮🇳
+ 1
import java.util.*; public class Program { public static void main(String[] args) { Scanner in=new Scanner(System.in); System.out.println("Enter a no. to guess"); int n=in.nextInt(); System.out.println("Entered no.: "+n); int a=((int)(Math.random()*50+1)); System.out.println("Random no. from 1 to 50 range generated by ai: "+a); if(a==n) System.out.println(" :O You have beaten down the ai"); else System.out.println("Try again next time "); } }
23rd Aug 2022, 3:20 PM
ASWANTH P
ASWANTH P - avatar
+ 1
Thanks man
23rd Aug 2022, 3:31 PM
ASWANTH P
ASWANTH P - avatar
0
Try to run
23rd Aug 2022, 3:20 PM
ASWANTH P
ASWANTH P - avatar
0
" This program needs an input " this is what I see when I tap the 'run'
23rd Aug 2022, 3:27 PM
ASWANTH P
ASWANTH P - avatar
0
I'm a beginner I don't know how to solve it
23rd Aug 2022, 3:28 PM
ASWANTH P
ASWANTH P - avatar
0
Can you please help
23rd Aug 2022, 3:28 PM
ASWANTH P
ASWANTH P - avatar