Skip to content
← Back to Community
6.3. While: Power of two
Profile icon
pole55

"For a given integer X, find the greatest integer n where 2ⁿ is less than or equal to X. Print the exponent value and the result of the expression 2ⁿ."

Example input
50

Example output
5 32

Voters
Profile icon
OtPrez
Profile icon
SK10IW
Profile icon
XinhanZhang
Profile icon
KWANCHANOKKOMNE
Profile icon
stu1082141
Profile icon
2024fantasal
Profile icon
hassanrahim1990
Profile icon
KhicheenguiElbe
Profile icon
ehdaa
Profile icon
fermaccio