
Please help me out...
U enter values like 239, 2543.876, 962.... Give me an equation without using any function which will give output of 240, 2545, 960 respectively...

import java.io.*;
class RoundTo5Multiplicant
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String a=br.readLine();
int num=Integer.parseInt(a);
int div=num%5;
if(div<=2)
num-=div;
else if(div>2)
num+=(5-div);
System.out.println("The final result is: "+num);
}
}