Write a program to display the series upto 10 terms:
15,28,41.....................................................
Answers
Answered by
15
import java.util.*;
public class Series
{
public static void main(String args[])
{
int a=13, n;
for(n=1;n<=10;n++)
{
a=a*n+2;
System.out.println("The series is"+a);
}
}
}
Answered by
14
import java.util.*;
public class Series
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a=2,b=13,c;
//using for loop
for(c=1;c<=10;c++)
{
a=a+b;
System.out.println("The series is"+a);
}
}
}
Similar questions
English,
6 months ago
Biology,
6 months ago
English,
6 months ago
Environmental Sciences,
1 year ago