For every program, there should be a softcopy file containing (i) Algorithm/Flowchart, (ii)
Source Code, (iii) Output
Q.1. Write a program to find squres and cubes of first n natural numbers.
1
Expert's answer
2022-01-13T09:39:25-0500
(i) Algorithm
Start
Declare variable n
Read n
fori=0 toSetsqures=i*i
Setcubes=i*i*i
Display i,squres,cubes
Stop
(ii) Source Code
n=int(input("Enter n: "))
for i in range(0,n):
squres=i*i
cubes=i*i*i
print(f"{i}\t\t{squres}\t\t{cubes}")
(iii) Output
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments