Write an algorithm that takes the positive integer ‘n’ as input and returns the exponent 2^n as output. Analyze the time complexity of the algorithm using program step table method.
n=input("Enter positive integer")
b=n^2
print(b)
Find time complexity:
because the algorithm has three steps.
Comments
Leave a comment