Computer Science, asked by Mochi1013, 1 year ago

1.7 Code Practice: Question 1
Write a program that uses two input statements to get two words as input. Then, print the words on one line separated by a space.


please help :(( i dont know this

Answers

Answered by AadilPradhan
1

Answer:

Explanation:

import java.util.*;

public class word

{

   public static void main(String args[])

   {

       Scanner sc=new Scanner (System.in);

       System.out.println("Ënter two words");

       String s1=sc.nextLine();  // to accept input from user

       String s2=sc.nextLine();

       String s3=s1+" "+s2;  // to add two words with a space

       System.out.println(s3);

       

   }

}  

Similar questions