Math, asked by arre29, 1 year ago

Write a program to display the following series upto 10 terms:
4,6,8.......................................

Answers

Answered by Anonymous
5

import java.util.*;

public class Series

{

public static void main(String args[])

{

int a=2,b;

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

{

a=a*b+2;

System.out.println("Display the series"+a);

}

}

}

Answered by Anonymous
7

import java.util.*;

public class Series

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

int a,b=2,i;

//using for loop

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

{

//using do while loop

do

{

a=a*i+b;

while

{

a=2;

}

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

}

}

}

}

Similar questions