Computer Science, asked by Aartisinghal82, 3 months ago

Write a script to accept the name and designation from the user and show them together on the
same line separated by a space.

Answers

Answered by samarthkrv
0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

 System.out.print("Enter your name:");

 String name = sc.nextLine();

 System.out.print("Enter your designation:");

 String designation = sc.nextLine();

 System.out.print(name + " " + designation);

}

}

Explanation:

Similar questions