Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class zMethods_P05_AddAndSubstract {
  4. public static void main(String[] args) {
  5.  
  6. System.out.println(substractTwoNumbers());
  7. //________________________________________________________________________
  8. }
  9.  
  10. static int substractTwoNumbers() {
  11. Scanner scanner = new Scanner(System.in);
  12.  
  13. int num1 = Integer.parseInt(scanner.nextLine());
  14. int num2 = Integer.parseInt(scanner.nextLine());
  15. int num3 = Integer.parseInt(scanner.nextLine());
  16.  
  17. int result = sumOfTwoNumbers(num1, num2) - num3;
  18.  
  19. return result;
  20.  
  21. }
  22.  
  23. static int sumOfTwoNumbers(int num1, int num2) {
  24. int sum = 0;
  25. sum = num1 + num2;
  26. return sum;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement