+ 1

How can I make 2 Scanners?

I mean, how can I make that I write 2 numbers and then the system is calculating the total... look at what I did and help me plz https://code.sololearn.com/cJrBmk6dhe69/?ref=app

1st Apr 2020, 5:09 PM
Yahel
Yahel - avatar
3 Answers
+ 5
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc= new Scanner(System.in); double a1= sc.nextDouble(); double b1= sc.nextDouble(); double total= a1 + b1; System.out.println (total); } }
1st Apr 2020, 5:26 PM
Cmurio
Cmurio - avatar
+ 5
It is not necessary, with one it is more than enough
1st Apr 2020, 5:26 PM
Cmurio
Cmurio - avatar
1st Apr 2020, 5:32 PM
Yahel
Yahel - avatar