write a simple Java program to print your name, registeration number,class,section and email id
Answers
Answered by
2
Answer:
Input your first name: James
Input your last name: Smith
Hello
James Smith
Explanation:
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner input = new Scanner (System.in);
System.out.print("Input your first name: ");
String fname = input.next();
System.out.print("Input your last name: ");
String lname = input.next();
System.out.println();
System.out.println("Hello \n"+fname+" "+lname);
}
}
Similar questions