Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class calc
- {
- public static void main(String args[])
- {
- Scanner kb = new Scanner(System.in);
- System.out.println("Enter your first number: ");
- double x = kb.nextDouble();
- System.out.println("Enter your second number: ");
- double y = kb.nextDouble();
- double add = x+y;
- double sub = x-y;
- double dub= x*y;
- double nub = x/y;
- System.out.println("The result of adding is "+add);
- System.out.println("The result of subtracting is "+sub);
- System.out.println("The result of multiplying is "+dub);
- System.out.println("The result of dividing is "+add);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement