Hello everybody,
I'm trying to test a kind of code like this one:
import java.util.Scanner; public class Demo { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.print("number 1 :"); int n1= sc.nextInt(); System.out.print("number 2 :"); int n2= sc.nextInt(); int s = n1+n2; System.out.println(s); }When i execute it in a console , with for example 3 and 4 for number 1 and number 2, i get :
number 1 :3
number 2 :4
7
But with code runner, i have to write for expected output :
number 1 :number 2 :7
All in the same line.
with standard input :
3
4
I think that it's because ENTER key is not managed by code runner as in console mode.
Is it possible to tell him that the user has pressed the ENTER key to get the same display as in console mode ?
Thank you for your help.
Michel