Programming Example

WAP to read a number in n and prints n^2, n^3, n^4

Solution

n=int(input("Enter the value of n : "))
print("n^2 : ",n*n)
print("n^3 : ",n*n*n)
print("n^4 : ",n*n*n*n)
Output