JAVA Program that take value user at run time mean at the time of console interaction.
import java.util.Scanner;
import java.util.Scanner;
class Program
{
public static void main(String []args)
{
Scanner input=new Scanner(System.in);
int number=input.nextInt();
float fNumber=input.nextFloat();
String value=input.nextLine(); //get value string at console
System.out.println(number); //Print the integer value
System.out.println(fNumber); //Print the Float Number
System.out.println(value); //Print the String value
}
}
INPUT
4
5.5
yasir
OUTPUT
4
5.5
No comments:
Post a Comment