Nearest Power Of Two
Computer Mathematics
Medium
3 views
Problem Description
Given n>0, print the smallest power of 2 that is >= n.
Input Format
One integer n.
Output Format
One integer.
Official Solution
Start p=1 and keep doubling while p<n. Output p.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!