Answer:
Here is code in Java.
// import package
import java.util.*;
class Main
{ // main method of class
public static void main (String[] args) throws java.lang.Exception
{
try{
// variables to store the input
int birthMonth,birthYear;
// Scanner class object to read the input
Scanner scnr=new Scanner(System.in);
System.out.print("Please enter the birth month:");
// read the birth month
birthMonth=scnr.nextInt();
System.out.print("Please enter the birth year:");
// read the birth year
birthYear=scnr.nextInt();
// print the output
System.out.println(birthMonth+"/"+birthYear+"\\");
}catch(Exception ex){
return;}
}
}
Step-by-step explanation:
Create two variables "birthMonth" & "birthYear" to store the birth month and birth year.Read the values of both from user. Print the birth month and birth year separated by a slash("/").
Output:
Please enter the birth month:1
Please enter the birth year:2000
1/2000
Please enter the birth month:5
Please enter the birth year:1950
5/1950