Write a program to display the following series:
16,31,46...................................................
Answers
Answered by
2
import java.util.*;
public class series
{
public static void main(String args[])
{
Scanner in =new Scanner(System.in);
int a=1,i=15,s=1;
//using do while loop
do
{
a=a+i;
while(s<=10);
s++
}
System.out.println("Display the series"+a);
}
}
Answered by
1
import java.util.*;
public class Series
{
public static void main(String args[])
{
int a=1,b;
for(b=1;b<=10;b++)
{
a=a*b+1;
System.out.println("Display the series"+a);
}
}
}
Similar questions