i am confuse about this problem.. a double value is given as input,such as 7.2 now output willbe 7.3 and 8. if input is 7.2.3 then output will be 7.2.4 and 7.3.3. i have tried below code so far
public class StrTest3 {
public static void main(String args[]){
double num=0;
double counter=0.0;
Scanner sc=new Scanner(System.in);
System.out.println("Enter number: ");
num=sc.nextDouble();
double num2=(double)Math.round(num);
}}
but its output for 7.2 is 7.0.. please help