RGAlex

O5. Add And Subtact

Feb 8th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package ExerciseMethoods;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class O5AddAndSubtact {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int a = Integer.parseInt(scanner.nextLine());
  9.         int b = Integer.parseInt(scanner.nextLine());
  10.         int c = Integer.parseInt(scanner.nextLine());
  11.         System.out.println(sum(a, b) - subtract(c));
  12.  
  13.     }
  14.  
  15.     public static int sum(int a, int b) {
  16.         return a + b;
  17.     }
  18.  
  19.     public static int subtract(int c) {
  20.         return c;
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment