Computer Science, asked by chandanagowda2005, 1 year ago

WRITE THE PROGRAM IN JAVA TO DISPLAY THE FIRST TEN TERMS OF THE SERIES
24,99,224,399.................

Answers

Answered by ayanbhatmdh
12

Answer:

class series

{

public static void main()

{

int m=6, n=4;

for( int i =1; I<=10;I++)

{

int p=m*n;

System.out.println(p);

m=m+5;

n=n+5;

}

}

}

Explanation:

Answered by poojan
14

PROGRAM IN JAVA TO DISPLAY THE FIRST TEN TERMS OF THE SERIES

24,99,224,399.................

Language Using : Java Programming

Program:

import java.util.Scanner;

public class Something

{

public static void main(String[] args)

{

Scanner sc= new Scanner(System.in);

System.out.println("Enter the range of the series :");

int n = sc.nextInt();

for(int i=1;i<=n;i++)

{

  System.out.print(((5*i)*(5*i)-1)+"  ");

}

}

}

Input :

Enter the range of the series : 10

Output :

24  99  224  399  624  899  1224  1599  2024  2499

Explanation :

The series goes on as follows :

(5x1)² - 1 = 24

(5x2)² - 1 = 99

(5x3)² - 1 = 224

and so on...

So, we take the range of the series as an input (n) and write a loop starting from one to the range and write a statement of arithmetic that deals with squaring of the (5*i) and then subtracts 1 from the result and print it. As soon as the loop iterates n times , printing n terms, it termintes and the series of n terms will be displayed on output screen.

Know more of java at:

  • Simple Arithmetic Expression Evaluation.

        https://brainly.in/question/18807971

  • Using the Scanner class efficiently.

        https://brainly.in/question/13467570

Hope it helps. Thank you!

Attachments:
Similar questions