Printing the string literal 'Hello World' for first line. Next line, printing the content of the variable.
you need to print all the content of the variable to stdout.
Code:
/* Read input from STDIN. Print your output to STDOUT*/
import java.io.*;
import java.util.*;
public class MyCode {
public static void main(String args[] ) throws Exception {
//Write code here
Scanner s=new Scanner(System.in);
String st=s.nextLine();
System.out.println("Hello World");
System.out.println("" +st);
}
}
Output:
Hello World, Welcome to RAw
you need to print all the content of the variable to stdout.
Code:
/* Read input from STDIN. Print your output to STDOUT*/
import java.io.*;
import java.util.*;
public class MyCode {
public static void main(String args[] ) throws Exception {
//Write code here
Scanner s=new Scanner(System.in);
String st=s.nextLine();
System.out.println("Hello World");
System.out.println("" +st);
}
}
Output:
Hello World, Welcome to RAw
No comments:
Post a Comment