Write a program to input 2 integers and check whether both the numbers are multiples of 7 or not.
Answers
Answered by
3
Question:-
➡ Write a program to input 2 integers and check whether both the numbers are multiples of 7 or not.
Program:-
This is written in Python.
a, b=int(input()), int(input())
if a%7==0 and b%7==0:
print("Both numbers are multiple of 7.")
else:
print("Both numbers are not a multiple of 7.")
Answered by
7
Answer:
- Write a program to input 2 integers and check whether both the numbers are multiples of 7 or not.
- This is done in JAVA
import java.util.*;
class integers
{
public static void main(String ar[])
{
Scanner sc=new Scanner (System.in);
System.out.println("Enter 2 numbers");
int a=sc.nextInt();
int b=sc.nextInt();
if (a%7==0)&&(b%7==0)
System.out.println("Multiple of 7");
else
System.out.println("Not multiple of 7");
}
}
Similar questions