Multiples of seven || Arithmetic operation || Java programs || Java
In this, we are going to write a simple program to check Multiples of a Number in Java.


import java.util.*;

class Multiples_7 
{
    public static void main(String[] args) 
    {
        Scanner sc = new Scanner(System.in);
        int a, b;
        System.out.println("Enter 2 integers:");
        a = sc.nextInt();
        b = sc.nextInt();
        if (a % 7 == 0 && b % 7 == 0) 
        {
            System.out.println("Both are multiples of 7");
        } 
        else 
        {
            System.out.println("Both are not multiples of 7");
        }
    }
}
#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post