Eliminate the decimal part of a number in Java

 Eliminate the decimal part of a number in Java

 

Java Program to eliminate the point value:

import java.util.*;
class RemovePointValue{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float data = sc.nextFloat();
System.out.println((int)data);
}


Sample Input/Output:

Comments

Popular posts from this blog

Convert binary to decimal in c using built in function

Install nodeJs in linux

DFS in Complete Tree