Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- String name;
- int age;
- System.out.print("Hello. Whats your name?");
- name = keyboard.next();
- System.out.print("Hi," + name + " How old are you?");
- age = keyboard.nextInt() ;
- System.out.print("Did you know that in 5 years you will be " + (age + 5) + " years old?");
- System.out.print("And five years ago you were" + (age - 5) + " Imagine that!!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement