Advertisement
coasterka

#1SumTwoNumbers

May 9th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SumTwoNumbers {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         System.out.println("Enter first number: ");
  7.         int firstNumber = scan.nextInt();
  8.         System.out.println("Enter second number: ");
  9.         int secondNumber = scan.nextInt();
  10.         int sum = firstNumber + secondNumber;
  11.         System.out.printf("Sum = %d%n", sum);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement