Steps Execution
Problem Statement
Take 4 digit number input from the user, add 8 to it and then divide it by 3(Only take integer part) Now, the modulus of that number is taken with 5 and then multiply the resultant value by 5. Display the final result.
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
needed
class Main {
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int i = (((n + 8)/3)%5)*5;
System.out.println(i);
}
}