write a programme to print the series 5,10,20,25
Answers
Answered by
0
Java:
public class Series {
public static void main(String[ ] args) {
for (int i = 1; i < 6; i++)
System.out.print(i * 5 + " ");
}
}
Python:
for i in range(5, 26, 5):
print(i, end = " ")
Answered by
2
Question:-
Write a program to print the series.
5 10 20 25 35 40 50
(i.e., +5, +10,+5,+10)
Program:-
Here is your program in Python.
n=int(input("Enter the number of terms for the series: "))
a=b=c=5
for i in range(0,n):
print(a, end=" ")
a=a+b;
b=b+c
c=c*-1
Similar questions
Math,
5 months ago
Science,
5 months ago
Math,
5 months ago
Math,
11 months ago
English,
11 months ago
Biology,
1 year ago
Computer Science,
1 year ago
Computer Science,
1 year ago