Write a program to display the following series upto 10 terms:
4,7,10.........................................
Answers
Answered by
1
import java.util.*;
public class Series
{
public static void main(String args[])
{
int c=3,m;
for (m=1;m<=10;m++)
{
c=c*m+1;
System.out.println("The series is"+c);
}
}
}
Answered by
1
import java.util.*;
public class Series
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a=3,b;
//using for loop
for(b=1;b<=10;b++)
{
a=a*b+1;
System.out.println("The series is"+a);
}
}
}
Similar questions
Political Science,
6 months ago
Physics,
6 months ago
History,
11 months ago
Psychology,
11 months ago
English,
1 year ago
English,
1 year ago