Answers for "round to the next multiple of 5"

0

round to the next multiple of 5

public class Main
{
	public static void main(String[] args) {
    int num = 5;
    int nextMultipleOfFive = (num/5+1)*5;
    System.out.println(nextMultipleOfFive);
	}
}
Posted by: Guest on December-30-2020
0

round to nearest multiple of 5 python from both end

#round up to multiple of 5 from both end
def rof(x,y,z):
    if x%5==4:
        x+=1
    elif x%5==1:
        x-=1
    elif x%5==2:
        x-=2
Posted by: Guest on June-06-2020

Code answers related to "round to the next multiple of 5"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language