Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Task02
- {
- public static void main(String[] args)
- {
- int value1;
- int value2;
- Scanner input= new Scanner(System.in);
- System.out.println("Please enter 1st integer: ");
- value1 = input.nextInt();
- System.out.println("Please enter 2nd integer: ");
- value2 = input.nextInt();
- }
- public static void doCalculation(int val1, int val2)
- {
- //
- int c = val1 + val2;
- System.out.println("The result of " + val1 + "+" + val2 + "is" + c);
- int d = val1 - val2;
- System.out.println("The result of " + val1 + "-" + val2 + "is" + d);
- int e = val1 * val2;
- System.out.println("The result of " + val1 + "*" + val2 + "is" + e);
- int f = val1 / val2;
- System.out.println("The result of " + val1 + "/" + val2 + "is" + f);
- //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement