write a program to find the square of the given number using function
Answers
Answered by
6
def sqaure(num):
i=1
sum = 0
while i<=num:
sum = sum + (i * i)
i=i+1
return sum
num1 = int(input("Enter a number: "))
print ("Sum = ", sqaure(num1))
Hope it helps :)
Similar questions