import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
Scanner age = new Scanner (System.in);
System.out.println("write your name here");
String name = age.next();
System.out.println("write your year of birth");
int yeardob = age.nextInt();
System.out.println("write your month of birth");
int monthdob = age.nextInt();
System.out.println("present year ");
int yeartoday = age.nextInt();
System.out.println("present month");
int monthtoday = age.nextInt();
int age1 = yeartoday- yeardob;
int age2 = monthtoday- monthdob;
System.out.print(name);
System.out.print(" your age is =");
System.out.print(age1);
System.out.print("year/");
System.out.print(age2);
System.out.print("month/nulldays");
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: