ANSWER IT
DONE WITH PYTHON PROGRAM
Attachments:
Answers
Answered by
0
Answer:
code is given below:
Explanation:
a=int(input('enter the nth term'))
for i in (1,a+1):
print('squares',i*i)
for j in (1,a+1):
print('cubes',i*i*i)
Answered by
1
Question:-
- WAP to accept and print squares and cubes of first n natural numbers.
Program:-
In python,
n=int(input("Enter the number of terms: "))
print("Squares of the numbers are... ")
for i in range(1,n+1):
print(i**2, end=" ")
print("\nCubes of the number are.. ")
for j in range(1, n+1):
print(j**3,end=" ")
Similar questions