Computer Science, asked by ushasodhani1, 1 year ago

to print the series in java- 0,3,8,15.....upto 10 terms

Answers

Answered by nain31
24
 \bold{ About \: java }

Java is a machine independent language which can work on any platform. Its an object oriented programming which stress on object rather than data.

The main parts while doing Java programming are package, Class ,input variables, condition updating.

 \bold{ About \: given \: series }

◼The given series follows (square -1 ) pattern.

Example

1×1 = 1 -1 =0

2×2 = 4 - 1 = 3

3 × 3 = 9 - 1 =8

The following programming is done by io package of Java.

 \huge \bold{CODING}

import java.io.*;

class series

{

public static void main(String args[])throws Exception

{

int i ,p;

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

{

p= (i*i)-1;

System.out.print(p+" ");

}

}

}
Answered by IshamAhmed
1

Answer:

I am just giving necessary variables and main working of

the loop structures

int n=1, i, res=0;

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

{

res= 25(n*n)-1;

System.out.print(res +" , ");

n++;

}

}

}

Similar questions