New Question, New Challenge!!!
Write a menu-driven program to print the the following series:
I) 12 15 36 117 480..nth term
Logic: 1st term × I + 3 × I = second term (I=loop)
II) 16 22 33 49 70..nth term
III) 6 11 16 21...nth term
_
• Think the Logic for 2nd and third one..xD
• Programming Language accepted: Java/Python/QBASIC.
Answers
Answered by
3
Answer:
The given cσdes are written in Python.
1. 12 15 36 117 480...N terms.
n,a=int(input("Enter limit - ")),12
for i in range(1,n+1):
print(a,end=" ")
a=i*(a+3)
Logic: Mentioned in the question.
2. 16 22 33 49 70...N terms.
n,a,b=int(input("Enter limit - ")),16,6
for i in range(1,n+1):
print(a,end=" ")
a,b=a+b,b+5
Logic: Difference between each term is - {6,11,16,21...} and difference between these values is 5.
3. 6 11 16 21...N terms.
n,a=int(input("Enter limit - ")),6
for i in range(1,n+1):
print(a,end=" ")
a+=5
Logic: First term is 6, common difference is 5.
Refer to the attachment for output.
•••♪
Attachments:
Similar questions