Computer Science, asked by chandrushekarrocks28, 6 months ago

Write and Construct Algorithm To Check a Number Divisible By 5 or Nor?​

Answers

Answered by shanuraj4137
1

Answer:

Given a number, the task is to check if number is divisible by 5. The input number may be large and it may not be possible to store even if we use long long int.

Examples:

Input : n = 56945255

Output : Yes

Input : n = 1234567589333150

Output : Yes

Input : n = 3635883959606670431112222

Output : No

Explanation:

hope it's helpful

Answered by Anonymous
0

Java Program to Check Whether Given Number is Divisible by 5

1. public class Check_Divisiblity.

int n;

2. Scanner s = new Scanner(System.

3. System. out. print("Enter any number:");

n = s. nextInt();

if(n % 5 == 0)

4. System. out. println(n+" is divisible by 5");

5. System. out. println(n+" is not divisible by 5");

Similar questions