Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.inputtext;
- import java.util.Scanner;
- public class ADDNUMSUBNUM {
- public static void main(String[] args) {
- double calcadd1, calcadd2;
- Scanner input = new Scanner(System.in);
- System.out.println("Input Numberone: ");
- double input1 = input.nextDouble();
- System.out.println("Enter Numbertwo: ");
- double input2 = input.nextDouble();
- System.out.println("Enter Numberthree: ");
- double input3 = input.nextDouble();
- System.out.println("Input Numberfour: ");
- double input4 = input.nextDouble();
- System.out.println("Enter Numberfive: ");
- double input5 = input.nextDouble();
- System.out.println("Input Numbersix: ");
- double input6 = input.nextDouble();
- calcadd1 = (input1+input2+input3);
- System.out.println("The value first three numbers is: " + calcadd1);
- calcadd2 = (input4+input5+input6);
- System.out.println("The value of the Second three numbers is: " + calcadd2);
- double subtract = calcadd1 - calcadd2;
- System.out.println("Difference of the two numbers is: " + subtract);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement