Computer Science, asked by anushkaarora407, 4 months ago

Generate following series:- 5, 10, 15, 20 upto N number​

Answers

Answered by Oreki
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