# Tagged: MISC

## Find numbers which are palindrome in both their decimal and octal Representations

Objec­tive: Given a range of inte­gers, find all the num­bers which are palin­drome when they are rep­re­sented in Dec­i­mal Value( base 10) and in Octal value(base 8). Exam­ple : Num­ber : 373 (Dec­i­mal) and digits…

## Colorful Numbers

Objec­tive: Given a num­ber, find out whether its col­or­ful or not. Col­or­ful Num­ber: When in a given num­ber, prod­uct of every digit of a sub-sequence are dif­fer­ent. That num­ber is called Col­or­ful Num­ber. See Example…

## Goldbach’s Conjecture

Goldbach’s con­jec­ture — Every even inte­ger greater than 2 can be rep­re­sented as the sum of two primes num­bers. Exam­ple: Given Num­ber : 200 Prime Num­bers are 3 197 Prime Num­bers are 7 193 Prime…

## Convert Decimal into Irreducible Fraction

Objec­tive: Given a dec­i­mal num­ber, con­vert it into irre­ducible frac­tion. Irre­ducible Frac­tion : An irre­ducible frac­tion is a frac­tion in which the numer­a­tor and denom­i­na­tor are inte­gers that have no other com­mon divi­sors than…

## Clock Angle Problem

Objec­tive: Find the Angle between hour hand and minute hand at the given time. Exam­ple: Time : 12:45 Input : hour = 12, Minute = 45 Out­put : 112.5 Time : 3:30 Input : hour…

## OR use only Max() function.">Sort 3 Integers without using if condition OR use only Max() function.

Objec­tive: — Given three inte­gers, sort them with­out using if con­di­tion. Appraoch: Say 3 inte­gers are, a, b, c. Find the max­i­mum of a, b, c using Max() func­tion. mul­ti­ply all inte­gers by –1. Again…

## GCD)">Euclidean algorithm — Greatest Common Divisor(GCD)

The great­est com­mon divi­sor (GCD) of two or more inte­gers, when at least one of them is not zero, is the largest pos­i­tive inte­ger that divides the num­bers with­out a remain­der. For exam­ple, the…