|
|
Part 1
Implement a function which takes
an integer value and returns a Boolean.
The return value should indicate
whether the binary representation of the input integer
is palindrome or not. A word or
phrase is palindrome if it reads the same backward as forward.
|
// Examples:
//
// Input
Output Binary representation
// -----
------ ---------------------
// 0
true 00000000000000000000000000000000
// 4294967295 true
11111111111111111111111111111111
// 2863289685 true
10101010101010100101010101010101
// 4294901760 false
11111111111111110000000000000000
//
//
Part 2
Implement a function which takes
an unsigned long and returns an unsigned long.
The return value should indicate
the sum of digits in the input unsigned long.
// Examples
//
Input Output
//
----- ------
// 0
0
// 55
10
// 14798
29
// 4294901760
42
// 4294967295
57
//
Part 3
Implement a function which returns
an unsigned long which indicates sum of Fibonacci numbers possible within the
range given as input.(Include the range values also)
// Examples:
//
// Input
Output
// -----
------
// 0,0
0
// 0,5
12
-> (0+1+1+2+3+5 = 12 )
// 1,3
7
-> (1+1+2+3 =
7 )
// 100,300
377
-> (144+233 =
377)
// 400,500
0
-> (No Fibonacci numbers in this range)
Contest is no Fun with out some
rules:
Rules:
-> Optimize for speed.
-> Data must not be
cached between successive function calls,
(i.e., no global/static variables allowed).
-> No LUT (Look-Up
Tables) allowed.
-> Use of standard C
library is permitted.
Answers for all parts must
be submitted .
Send your answers to
contests@fairbytes.com
as zip file which contains c/cpp, header files.
Deciding factors for finding
the winner will be
- Coding style
- Efficiency
- And time taken for operation.
There are lots of cool prizes to be won like Software CDs, Technical Books,
T-Shirts etc to name a few.
You can discuss about this contest
at http://www.fairbytes.com/phpbb/phpBB2/viewtopic.php?t=35
Last date for submitting is 30-Jan-2007