Computer Science, asked by Riyagusain2010, 6 months ago

Write a program to check if a number is divisible by 8.​

Answers

Answered by anindyaadhikari13
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 bilasvakharia
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