Write a Javascript code to enter your name and age . If name is Divya and age is 16 then display the statement "Divya is 16 years old." as output
Answers
Answered by
1
import java.util.*;
public class nameage
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String name;
int age;
System.out.println("enter you name");
name=sc.next();
System.out.println("enter your age");
age=sc.nextInt();
System.out.println(name+" is "+age+" years old.");
}
}
Similar questions