12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
-
- import java.util.Scanner;
-
- public class ShortCalculator {
-
-
- public static short S1;
-
- public static short S2;
-
-
- public static short sum;
-
- public static short diff;
-
- public static short product;
-
- public static short quotient;
-
- public static short remainder;
-
-
-
-
-
- public static void ShortCalculator(){
-
- Scanner scanner = new Scanner(System.in);
-
- System.out.println("Enter your first Short: ");
-
- S1 = scanner.nextShort();
-
-
-
- System.out.println("Enter your Second Short: ");
-
- S2 = scanner.nextShort();
-
-
-
- System.out.println(S1);
-
- System.out.println(S2);
-
-
-
- sum = (short) (S1 + S2);
-
- diff = (short) (S1 - S2);
-
- product = (short) (S1 * S2);
-
- quotient = (short) (S1 / S2);
-
- remainder = (short) (S1 % S2);
-
-
-
- System.out.println("Sum is " + sum);
-
- System.out.println("Diff is " + diff);
-
- System.out.println("Product is " + product);
-
- System.out.println("Quotient is " + quotient);
-
- System.out.println("Remainder is " + remainder);
-
-
- }
- }
|