Register

Login

CODECRAFT LEVEL ONE

Problem 1:

Given a positive integer n, find the odd integer o and the integer p such that n = o*2 to the power p.

Example : For n = 24, o = 3 and p = 3.

Task: Write a program that:
1. Reads a positive integer n from the standard input,
2. Computes the odd integer o and the integer p such that n = o*2 to the power p.
3. Writes the result to the standard output.

Input:
The first and only line of the input contains exactly one integer n, 1 <= n <= 10 to the power 6.

Output:
The output should contain two integers o and p separated by a single space such that n = o*2 to the power p.

Example:
For the input:
24

the correct answer is:
3 3



Problem 2:

Given a positive integer n, find the positions of all 1's in its binary representation. The position of the least significant bit is 0.

Example : For n = 24, o = 3 and p = 3.

Task: Write a program that:
1. Reads a positive integer n from the standard input,
2. Computes the positions of 1's in the binary representation of n.
3. Writes the result to the standard output.

Input:
The first and only line of the input contains exactly one integer n, 1 <= n <= 10 to the power 6.

Output:
The output should contain increasing sequence of integers separated by single spaces with the positions of 1's in the binary representation of the input number.

Example:
For the input:
13

the correct answer is:
0 2 3



Problem 3:

Check whether a given character upper case lower case or special case without using logical operators.













Copyright 2009.©Noesis 2009 
All rights reserved.

UPDATES

!!! Start crafting your code at Codecraft !!!

-Learner Guided for Ecotecture is availabel here.

-Online Registration will be  closed by 4th Sep 09

-Registration fees to be paid on  the spot on 5th Sep 9:30am

-Opening Ceremony -
        5th Sep 09 9:00am

-Events Starts-
        5th Sep 09 10:30am