Skip to main content

Divisibility Rules

Divisible by:If:Examples:
2The last digit is even (0,2,4,6,8)128 is
129 is not
3The sum of the digits is divisible by 3
381 (3+8+1=12, and 12÷3 = 4) Yes
217 (2+1+7=10, and 10÷3 = 3 1/3No
4The last 2 digits are divisible by 4
1312 is (12÷4=3)
7019 is not
5The last digit is 0 or 5175 is
809 is not
6The number is divisible by both 2 and 3114 (it is even, and 1+1+4=6 and 6÷3 = 2) Yes

308 (it is even, but 3+0+8=11 and 11÷3 = 3 2/3No
7If you double the last digit and subtract it from the rest of the number and the answer is:
  • 0, or
  • divisible by 7
(Note: you can apply this rule to that answer again if you want)
672 (Double 2 is 4, 67-4=63, and 63÷7=9) Yes
905 (Double 5 is 10, 90-10=80, and 80÷7=11 3/7No
8The last three digits are divisible by 8
109816 (816÷8=102) Yes
216302 (302÷8=37 3/4No
9The sum of the digits is divisible by 9

(Note: you can apply this rule to that answer again if you want)
1629 (1+6+2+9=18, and again, 1+8=9) Yes
2013 (2+0+1+3=6) No
10The number ends in 0
220 is
221 is not
11
If you sum every second digit and then subtract all other digits and the answer is:
  • 0, or
  • divisible by 11
1364 ((3+4) - (1+6) = 0Yes
3729 ((7+9) - (3+2) = 11Yes
25176 ((5+7) - (2+1+6) = 3No
12The number is divisible by both 3 and 4
648
(By 3? 6+4+8=18 and 18÷3=6 Yes.
By 4? 48÷4=12 Yes) Yes
524
(By 3? 5+2+4=11, 11÷3= 3 2/3 No.
Don't need to check by 4.) No

Comments

Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

Hackerrank > SQL > Basic Select

Select
01-Select All
Given a City table, whose fields are described as +-------------+----------+ | Field       | Type     | +-------------+----------+ | ID          | int(11)  | | Name        | char(35) | | CountryCode | char(3)  | | District    | char(20) | | Population  | int(11)  | +-------------+----------+
write a query that will fetch all columns for every row in the table.

My Solution
SELECT*FROM city;
---------------------------------------------------------------------------------
02-Select by ID
Given a City table, whose fields are described as

Zoho Puzzle Questions With Answers

Measuring Time Logic Puzzle You are given with two ropes with variable width. However if we start burning both the ropes, they will burn at exactly same time i.e. an hour. The ropes are non-homogeneous in nature. You are asked to measure 45 minutes by using these two ropes.

How can you do it?

Please note that you can’t break the rope in half as it is being clearly stated that the ropes are non-homogeneous in nature.
Answer & Explanation Solution: 45 minutes

Explanation :
All you have to do is burn the first rope from both the ends and the second rope from one end only simultaneously. The first rope will burn in 30 minutes (half of an hour since we burned from both sides) while the other rope would have burnt half. At this moment, light the second rope from the other end as well. Where, the second rope would have taken half an hour more to burn completely, it will take just 15 minutes as we have lit it from the other end too.

Thus you have successfully calculated 30+15 = 45 minutes …