Enter user defined values with different datatypes in java

Write a java program to enter user-defined values with different datatypes and print the values.

import java.util.*;
public class k 
   public static void main(String args[])
       Scanner s=new Scanner(System.in);
       int a;
       float b;
       double c;
       System.out.println("enter a:");
       a=s.nextInt();//syntax which asks value from user
       System.out.println("enter b:");
       System.out.println("enter c:");
       System.out.println("Value of a is: "+a);
       System.out.println("Value of b is: "+b);
       System.out.println("Value of c is: "+c);

Leave a Reply

Your email address will not be published. Required fields are marked *