➽ Program:-
import java.util.*;
class Main
{
public static void
main(String args[])
{
String str;
int num;
float fnum;
Scanner sc =
new Scanner(System.in);
//For
String Input
System.out.print("Enter
a String: ");
str =
sc.nextLine();
System.out.println("Result:
"+str);
//For
Integer Input
System.out.print("Enter
an Integer: ");
num =
sc.nextInt();
System.out.println("Result:
"+num);
//For
Float Number Input
System.out.print("Enter
a Float Number: ");
fnum =
sc.nextFloat();
System.out.println("Result:
"+fnum);
}
}
➽ Output:-
0 Comments
Please do not enter any spam link in the comment section.