WAP to check whether a number is exactly by 5 and 10.

3 years ago
OOP Java

Compile code:

class Divisibleby5and10{
public static void main(String[] args) {
        
      int n=5,r1,r2;
      r1=n%5;
      r2=n%10;
     System.out.println("Number is exactly divisible by 5: "+n);
     System.out.println("Number is exacctly divisible by 10: "+n);
    }
}

Output:

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions