Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Write a program SumTwoNumbers.java that enters two integers from the console,
- * calculates and prints their sum. */
- import java.util.Scanner;
- public class _06_SumOfTwoNumbers {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner(System.in);
- System.out.print("Enter two Integer numbers: ");
- int numA = scan.nextInt();
- int numB = scan.nextInt();
- long sumOfIntegers = numA + numB;
- System.out.println("The Sum of these 2 numbers is: " + sumOfIntegers);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement