Write a javascript code to input your name and age .if name is 'divya'and age 16 then display the statement ' 'divya'and is 16 years years old ' as output
Answers
Answered by
0
import java.util.*;
class name
{
public static void main(String args[])
{
Scanner SC=new Scanner(System.in);
System.out.println("Enter the name");
String n=SC.nextLine();
System.out.println("Enter the age");
int age=SC.nextInt();
System.out.println(n+"and is"+age+"years old");
}
}
class name
{
public static void main(String args[])
{
Scanner SC=new Scanner(System.in);
System.out.println("Enter the name");
String n=SC.nextLine();
System.out.println("Enter the age");
int age=SC.nextInt();
System.out.println(n+"and is"+age+"years old");
}
}
Similar questions