Powers of Two up to 128
easyQuestion 282Starting from 1, repeatedly double the value and print each result up to 128, one per line (see Expected Output).
Multiply by 2 each pass and stop once the value passes 128.
Expected output
1 2 4 8 16 32 64 128
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.