Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // import library for accepting input
- import java.util.Scanner;
- public class Exercise2
- {
- public static void main(String[] args)
- {
- int num1, num2, total;
- //Now we know where to accept input from
- Scanner keyboard = new Scanner(System.in);
- System.out.println("I HUNGER FOR DIGITS");
- num1 = keyboard.nextInt(); //Accepts the first number
- num2 = keyboard.nextInt(); //Accepts the second number
- total = num1 + num2;
- System.out.println("YOU FED ME " + total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement