WAP in JAVA to print this series
4,11,18,27,...................... n
Plz fast
Answers
Answered by
2
CODE :
import java.util.*;
class series
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a limit");
int n=sc.nextInt();
int s=0;
for(int i=1;i<=n;i++)
{
s=(i+1)*(i+1)+2;
System.out.print(s+" , ");
}
}
}
-------------------------------------------------------------------
OUTPUT :
Enter a limit
3
4 , 11 , 18
Hope it helps :-)
______________________________________________________________________
Anonymous:
inbox me please I need help bro
Similar questions