3.5 Divisibility
ā§Š.ā§Ģ āĻŦāĻŋāĻāĻžāĻā§āĻ¯āĻ¤āĻž (ā§Ŧ)
[23] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻā§ā§ āĻ¨āĻž āĻŦāĻŋāĻā§ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[23.1] āĻŽāĻĄā§āĻ˛āĻžāĻ¸ āĻ āĻĒāĻžāĻ°ā§āĻāĻ° āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻāĻ°ā§
[23.2] āĻŦāĻŋāĻāĻā§āĻžāĻāĻ āĻ āĻĒāĻžāĻ°ā§āĻāĻ° āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻāĻ°ā§ (Similar)
[24] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž ā§Š āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[25] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž ā§Š āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ Fizz, ā§Ģ āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ Buzz, ā§Š āĻ ā§Ģ āĻāĻā§ āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ FizzBuzz āĻĒā§āĻ°āĻŋāĻ¨ā§āĻ āĻāĻ°āĨ¤
[26] āĻāĻāĻāĻŋ āĻāĻāĻ°ā§āĻā§ āĻŦāĻ°ā§āĻˇ āĻ āĻ§āĻŋāĻŦāĻ°ā§āĻˇ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[27] āĻāĻāĻāĻŋ āĻāĻāĻ°ā§āĻā§ āĻŦāĻ°ā§āĻˇ āĻļāĻ¤āĻŦāĻ°ā§āĻˇā§ āĻ āĻ§āĻŋāĻŦāĻ°ā§āĻˇ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[28] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻ āĻ¨ā§āĻ¯ āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĻā§āĻŦāĻžāĻ°āĻž āĻ¨āĻŋāĻāĻļā§āĻˇā§ āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
āĻ¸āĻŽāĻžāĻ§āĻžāĻ¨
[23] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻā§ā§ āĻ¨āĻž āĻŦāĻŋāĻā§ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ (āĻŽāĻĄā§āĻ˛āĻžāĻ¸ āĻ
āĻĒāĻžāĻ°ā§āĻāĻ° āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻāĻ°ā§, āĻŦāĻŋāĻāĻā§āĻžāĻāĻ āĻ
āĻĒāĻžāĻ°ā§āĻāĻ° āĻŦā§āĻ¯āĻŦāĻšāĻžāĻ° āĻāĻ°ā§ (Similar))
4
Even
7
Odd
0
Even
[24] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž ā§Š āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
9
Divisible by 3
10
Not divisible by 3
27
Divisible by 3
14
Not divisible by 3
[25] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž ā§Š āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ Fizz, ā§Ģ āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ Buzz, ā§Š āĻ ā§Ģ āĻāĻā§ āĻĻā§āĻŦāĻžāĻ°āĻž āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻšāĻ˛ā§ FizzBuzz āĻĒā§āĻ°āĻŋāĻ¨ā§āĻ āĻāĻ°āĨ¤
15
FizzBuzz
9
Fizz
10
Buzz
7
(no output)
[26] āĻāĻāĻāĻŋ āĻāĻāĻ°ā§āĻā§ āĻŦāĻ°ā§āĻˇ āĻ
āĻ§āĻŋāĻŦāĻ°ā§āĻˇ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
2020
Leap year
1900
Not a leap year
2000
Leap year
2024
Leap year
2023
Not a leap year
[27] āĻāĻāĻāĻŋ āĻāĻāĻ°ā§āĻā§ āĻŦāĻ°ā§āĻˇ āĻļāĻ¤āĻŦāĻ°ā§āĻˇā§ āĻ
āĻ§āĻŋāĻŦāĻ°ā§āĻˇ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
1900
1900 is not a century leap year
2000
2000 is a century leap year
2100
2100 is not a century leap year
2200
2200 is not a century leap year
2400
2400 is a century leap year
2500
2500 is not a century leap year
[28] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻ
āĻ¨ā§āĻ¯ āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĻā§āĻŦāĻžāĻ°āĻž āĻ¨āĻŋāĻāĻļā§āĻˇā§ āĻŦāĻŋāĻāĻžāĻā§āĻ¯ āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
20 5
20 is exactly divisible by 5
10 3
10 is not exactly divisible by 3
25 0
Denominator cannot be zero
45 9
45 is exactly divisible by 9
34 7
34 is not exactly divisible by 7
Last updated