Write a program to check if a number is divisible by 8.
Answers
Answered by
2
Question:-
Write a program to check if a number is divisible by 8.
Program:-
This is written in Java.
import java.util.*;
class Number
{
public static void main(String s[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter the number: ");
int n=sc.nextInt();
if(n%8==0)
System.out.println("Number is divisible by 8.");
else
System.out.println("Number is not divisible by 8.");
}
}
Answered by
0
Answer:
Let us take a input greater..
Input : n = 1128
Output : Yes
Input : n = 1124
Output : No
Input : n = 363588395960667043875487
Output : No
Similar questions
English,
3 months ago
Math,
3 months ago
English,
3 months ago
English,
6 months ago
Computer Science,
11 months ago
Social Sciences,
11 months ago