+ 1

What am I doing wrong? Can anyone explain? What am I missing?

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //get salaries int salary1 = 1500; scanner.nextInt(); int salary2 = 3200; scanner.nextInt(); //your code goes here int sum = salary1 + salary2; System.out.println (sum); } }

20th Jan 2021, 5:46 PM
Elad David
Elad David - avatar
2 odpowiedzi
+ 3
Remove those values (1500 and 3200) from salary1 and salary2. Your program is already taking the input so you dont have to manually declare the values on your code. https://code.sololearn.com/cXL7XMcGjX0a/?ref=app
20th Jan 2021, 6:08 PM
noteve
noteve - avatar
+ 1
thank you :) Actualy I understood my mistake before i saw your comment. 😊
20th Jan 2021, 6:49 PM
Elad David
Elad David - avatar