4.2 Loop Exercise
ā§Ē.ā§¨ āĻ
āĻ¨ā§āĻļā§āĻ˛āĻ¨: āĻ˛ā§āĻĒ (ā§¨ā§¨)
[19] āĻ¯ā§āĻā§āĻ¨ā§ āĻāĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ¨āĻžāĻŽāĻ¤āĻž āĻĒā§āĻ°āĻŋāĻ¨ā§āĻ āĻāĻ°āĨ¤
[20] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĢā§āĻ¯āĻžāĻā§āĻāĻ°āĻŋāĻ¯āĻŧāĻžāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [N! = 1 Ã 2 Ã 3 Ã 4 Ã ......... Ã N]
[21] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
[22] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĒā§āĻ°āĻā§āĻ¤ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
[23] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻŽā§āĻ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻ¸āĻāĻā§āĻ¯āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[24] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[25] ā§§ āĻĨā§āĻā§ n āĻĒāĻ°ā§āĻ¯āĻ¨ā§āĻ¤ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻŽā§āĻšā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻā§āĻ˛ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[25.1] ā§§ āĻĨā§āĻā§ ā§Šā§Ļ āĻĒāĻ°ā§āĻ¯āĻ¨ā§āĻ¤ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻŽā§āĻšā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻā§āĻ˛ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[26] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° āĻā§ā§ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
[27] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° āĻŦāĻŋāĻā§ā§ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
[28] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ.āĻ¸āĻž.āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[29] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ˛.āĻ¸āĻž.āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[30] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻšāĻā§āĻŖāĻ (Co-Prime) āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [if GCD (a, b) == 1, then a and b are Co-Prime]
[31] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[32] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĒā§āĻ°āĻā§āĻ¤ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[33] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĒāĻžāĻ°āĻĢā§āĻā§āĻ (Perfect) āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[34] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž Perfect, Abundant, or Defective āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[35] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž Amicable āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [sopd(a)==b&&sopd(b)==a]
[36] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžā§ āĻā§āĻāĻŋ āĻ āĻāĻ āĻ°ā§ā§āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[37] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžā§ āĻ āĻāĻ āĻā§āĻ˛ā§āĻā§ āĻŦāĻŋāĻĒāĻ°ā§āĻ¤ āĻā§āĻ°āĻŽā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
[38] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ āĻāĻ āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
[39] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ āĻāĻ āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°, āĻ¯āĻ¤āĻā§āĻˇāĻ¨ āĻ¨āĻž āĻ¯ā§āĻāĻĢāĻ˛ āĻāĻ āĻ āĻāĻ āĻŦāĻŋāĻļāĻŋāĻˇā§āĻ āĻšā§āĨ¤
[40] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĒā§āĻ¯āĻžāĻ˛āĻŋāĻŖā§āĻĄā§āĻ°āĻŽ āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
āĻ¸āĻŽāĻžāĻ§āĻžāĻ¨
[19] āĻ¯ā§āĻā§āĻ¨ā§ āĻāĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ¨āĻžāĻŽāĻ¤āĻž āĻĒā§āĻ°āĻŋāĻ¨ā§āĻ āĻāĻ°āĨ¤
5
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
10
10 x 1 = 10
10 x 2 = 20
10 x 3 = 30
10 x 4 = 40
10 x 5 = 50
10 x 6 = 60
10 x 7 = 70
10 x 8 = 80
10 x 9 = 90
10 x 10 = 100
[20] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĢā§āĻ¯āĻžāĻā§āĻāĻ°āĻŋāĻ¯āĻŧāĻžāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [N! = 1 Ã 2 Ã 3 Ã 4 Ã ......... Ã N]
5
5! = 120
10
10! = 3628800
[21] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
28
1 2 4 7 14 28
100
1 2 4 5 10 20 25 50 100
[22] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĒā§āĻ°āĻā§āĻ¤ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
28
1 2 4 7 14
100
1 2 4 5 10 20 25 50
[23] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻŽā§āĻ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻ¸āĻāĻā§āĻ¯āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
28
6
100
9
[24] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
13
13 is a Prime Number
100
100 is a Not Prime Number
[25] ā§§ āĻĨā§āĻā§ n āĻĒāĻ°ā§āĻ¯āĻ¨ā§āĻ¤ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻŽā§āĻšā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻā§āĻ˛ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
30
2 3 5 7 11 13 17 19 23 29
100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
[25.1] ā§§ āĻĨā§āĻā§ ā§Šā§Ļ āĻĒāĻ°ā§āĻ¯āĻ¨ā§āĻ¤ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻŽā§āĻšā§āĻ° āĻŽāĻ§ā§āĻ¯ā§ āĻŽā§āĻ˛āĻŋāĻ (Prime) āĻ¸āĻāĻā§āĻ¯āĻž āĻā§āĻ˛ā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
2 3 5 7 11 13 17 19 23 29
[26] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° āĻā§ā§ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
28
2 4 14 28
100
2 4 10 20 50 100
[27] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻļā§āĻ§ā§āĻŽāĻžāĻ¤ā§āĻ° āĻŦāĻŋāĻā§ā§ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
28
1 7
100
1 5 25
[28] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ.āĻ¸āĻž.āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
56 98
14
20 28
4
[29] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ˛.āĻ¸āĻž.āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
12 15
60
20 25
100
[30] āĻĻā§āĻāĻāĻŋ āĻ¸āĻāĻā§āĻ¯āĻž āĻ¸āĻšāĻā§āĻŖāĻ (Co-Prime) āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [if GCD (a, b) == 1, then a and b are Co-Prime]
20 23
Co-Prime
20 25
Not Co-Prime
[31] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
28
56
100
217
[32] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻĒā§āĻ°āĻā§āĻ¤ āĻā§āĻĒāĻžāĻĻāĻ (Factor)/āĻā§āĻŖāĻ¨ā§āĻ¯āĻŧāĻ (Divisor) āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
28
28
100
117
[33] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĒāĻžāĻ°āĻĢā§āĻā§āĻ (Perfect) āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
28
28 is a Perfect Number
100
100 is a Not Perfect Number
[34] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž Perfect, Abundant, or Defective āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
28
28 is a Perfect Number
30
30 is a Abundant Number
35
35 is a Defective Number
[35] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž Amicable āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤ [sopd(a)==b&&sopd(b)==a]
220 284
Amicable Number
20 24
Not Amicable Number
[36] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžā§ āĻā§āĻāĻŋ āĻ
āĻāĻ āĻ°ā§ā§āĻā§ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
100
3
12345
5
[37] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžā§ āĻ
āĻāĻ āĻā§āĻ˛ā§āĻā§ āĻŦāĻŋāĻĒāĻ°ā§āĻ¤ āĻā§āĻ°āĻŽā§ āĻĒā§āĻ°āĻĻāĻ°ā§āĻļāĻŖ āĻāĻ°āĨ¤
12345
54321
987654321
123456789
[38] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ
āĻāĻ āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
12345
15
987654321
45
[39] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻžāĻ° āĻ
āĻāĻ āĻā§āĻ˛ā§āĻ° āĻ¯ā§āĻāĻĢāĻ˛ āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°, āĻ¯āĻ¤āĻā§āĻˇāĻ¨ āĻ¨āĻž āĻ¯ā§āĻāĻĢāĻ˛ āĻāĻ āĻ
āĻāĻ āĻŦāĻŋāĻļāĻŋāĻˇā§āĻ āĻšā§āĨ¤
12345
6
987654321
9
[40] āĻāĻāĻāĻŋ āĻĒā§āĻ°ā§āĻŖ āĻ¸āĻāĻā§āĻ¯āĻž āĻĒā§āĻ¯āĻžāĻ˛āĻŋāĻŖā§āĻĄā§āĻ°āĻŽ āĻ¸āĻāĻā§āĻ¯āĻž āĻāĻŋāĻ¨āĻž āĻ¨āĻŋāĻ°ā§āĻŖā§ āĻāĻ°āĨ¤
1221
1221 is a Palindrom.
123
123 is Not a Palindrom.
Last updated