Untitled

mail@pastecode.io avatar
unknown
java
15 days ago
461 B
1
Indexable
Never
Java
import java.util.Scanner;

public class NameAndAge {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.print("Enter   
 your name: ");
        String name = input.nextLine();

        System.out.print("Enter your age: ");
        int age = input.nextInt();

        System.out.println("Welcome   
 " + name + " :)");
        System.out.println("Your age next year is: " + (age + 1));
    }
}
Leave a Comment