Generate following series:- 5, 10, 15, 20 upto N number
Answers
Answered by
1
Python:
num = 5
for i in range(0, int(input("Enter N - "))):
print(num, end=" ")
num += 5
Java:
import java.util.Scanner;
public class Series {
public static void main(String[ ] args) {
System.out.print("Enter N - ");
int N = new Scanner(System.in).nextInt( );
for (int i = 0, num = 0; i < N; i++)
System.out.print((num += 5) + " ");
}
}
Similar questions
Math,
2 months ago
English,
2 months ago
Social Sciences,
4 months ago
Math,
4 months ago
Computer Science,
9 months ago
Computer Science,
9 months ago
Geography,
9 months ago