Simple IO program

 Simple IO program

Problem Description

Java program to a string, integer and float values as input and print them in output
Logic Test Case 1

Input (stdin)
Hello

3

4.5

Expected Output

Hello

3

4.5
Logic Test Case 2

Input (stdin)
Computer Science

3

4.59

Expected Output

Computer Science

3

4.59




Code Area

import java.util.*;

public class TestClass {

public static void main(String[] args) { 

Scanner g=new Scanner(System.in);

       String elakkiya=g.nextLine();

       int v=g.nextInt();

       float m=g.nextFloat();

       System.out.println(elakkiya);

       System.out.println(v);

       System.out.println(m);

}

}

Post a Comment

0 Comments