Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1.  // import library for accepting input
  2.  import java.util.Scanner;
  3.    
  4.    
  5.  public class Exercise2
  6.  {
  7.     public static void main(String[] args)
  8.     {
  9.         int num1, num2, total;
  10.         //Now we know where to accept input from
  11.         Scanner keyboard = new Scanner(System.in); 
  12.        
  13.         System.out.println("I HUNGER FOR DIGITS");
  14.         num1 = keyboard.nextInt(); //Accepts the first number
  15.         num2 = keyboard.nextInt(); //Accepts the second number
  16.        
  17.         total = num1 + num2;
  18.         System.out.println("YOU FED ME " + total);
  19.     }
  20.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement