0

I have the follow code for converting rupees to paisa, but for the input 1290.12 I should get 129012 but the program gives 129011,

The program is given below:

import java.util.*;
public class Hello{
    public static void main(String[] args){
       Scanner sc= new Scanner(System.in);
       double num = sc.nextDouble();
       System.out.print((long)(num*100));
    }
}

I tried the above code but for the input 1290.12 i am getting 129011 as output

0 Answers0