Write a program to input a number and check it is a multiple of 7 or not.
Answers
Answered by
2
Question:-
- Write a program to input a number and check it is a multiple of 7 or not.
Program:-
I am writing in python..
n=int(input("Enter a number: "))
if n%7==0:
print("Number is a multiple of 7...")
else:
print("Number is not a multiple of 7...")
Answered by
0
Answer:
import java.util.Scanner;
public class main
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.println("Input a number to check wether it is factor");
int a;
a=in.nextInt();
if(a%7==0)
{
System.out.println("The number is factor of 7");
}
else
{
System.out.println("The number is not a factor of 7");
}
}
}
Explanation:
I have written in Java, Hope it helps you.
Pls mark my answer as Brainliest and also follow me for more..
THANK YOU
Similar questions