Dremendo Tag Line

Check multiple of 5 in Java

if else - Question 5

In this question, we will see how to check if a number is a multiple of 5 or not in Java programming using the if else statement. To know more about if else statement click on the if else statement lesson.

Q5) Write a program in Java to input any number and check if it is multiple of 5 or not. A number is multiple of 5 if it is divisible by 5.


import java.util.Scanner;

public class Q5
    public static void main(String args[])
        int n;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter a number ");
            System.out.print("Multiple of 5");
            System.out.print("Not Multiple of 5");


Enter a number 10
Multiple of 5