Computer Science, asked by Anonymous, 9 months ago

Write a program to find the following series upto n terms16,30,44...

Answers

Answered by Anonymous
1

import java.util.*;

public class Series

{

public static void main(String args[ ])

{

Scanner in=new Scanner (System. in);

int a=14,b,c,n;

System.out.println("Enter the value of n");

n=in.nextInt();

for(b=1;b<=n;b++)

{

c=(a*b)+2;

System.out.println("The series is ="+c);

}

}

}

In the given series it is the additive result of 2 with the multiples of 14.

Such that,

(14×1)+2

=14+2

=16

(14×2)+2

=28+2

=30

(14×3)+2

=44+2

=46

And vice versa.

Similar questions