#K78772. Compute the Power of Two
Compute the Power of Two
Compute the Power of Two
Given a non-negative integer \( n \), calculate \( 2^n \) by iteratively multiplying by 2 without using the exponentiation operator or built-in power functions. You need to compute \( 2^n = 2 \times 2 \times \cdots \times 2 \) (multiplied \( n \) times).
If the input is negative, your program should output an appropriate error message. In this problem, the input will always be a non-negative integer, and therefore you can assume that error handling for negative inputs is just for completeness.
inputFormat
A single line of standard input containing a non-negative integer ( n ).
outputFormat
A single integer printed to standard output representing ( 2^n ).## sample
0
1
</p>