- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsum
More file actions
Latest commit
23 lines (16 loc) · 529 Bytes
/
Copy pathsum
File metadata and controls
23 lines (16 loc) · 529 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int first;
int second;
System.out.println("Enter first number");
first = input.nextInt();
System.out.println("Enter second number");
second =input.nextInt();
System.out.println("Sum: " + sum(first, second));
}
public static int sum(int firstNumber, int secondNumber){
return firstNumber + secondNumber;
}
}