Computer Science, asked by hiralalgautam6013, 4 months ago

write a Java program to print following series ​

Attachments:

Answers

Answered by gyaneshwarsingh882
0

Answer:

Explanation:

Print Series 1, -3n terms in Java.

public class OddSeries.

public static void main(String args[])

int n = sc.nextInt();

int i = 1, c, f = 1; // i for odd nos, c for counter, f for flag.

for (c = 1; c <= n; c++) {

if (f % 2 == 0) {

} else {

} //Loop ends.

Similar questions