AnkitWebLogic

Calculate Square and Cube

Exercise 3: WAP in Python to input number and calculate its square and cube. 1

#input number and find square, cube | ankitweblogic.com
a=int(input("Enter Number: "))
s=a*a
print("Square = " ,s)
c=a*a*a
print("Cube: " ,c)
Enter Number: 5
Square = 25
Cube = 125

Advertisement