write a program to print your name and age
Anonymous:
Can I write C program or Java program
Answers
Answered by
2
Hello friend..!!
import java.io.*;
Class details
{
public static void main( String args[]) throws IOException
{
System.out.println("My name is Nethu and my age is 20");
}
}
Hope you understood
import java.io.*;
Class details
{
public static void main( String args[]) throws IOException
{
System.out.println("My name is Nethu and my age is 20");
}
}
Hope you understood
Answered by
2
import java.util.*;
public class sample
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
System.out.println("enter ur name");
String a=in.nextLine();
System.out.println("enter ur age");
int b=in.nextInt();
}
}
public class sample
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
System.out.println("enter ur name");
String a=in.nextLine();
System.out.println("enter ur age");
int b=in.nextInt();
}
}
Similar questions