write a program to print the series of 2,5,8........n
Answers
Answered by
2
Answer:
import java.util.*;
public class Series
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,n;
System.out.println("Enter the value of n");
n=in.nextInt();
System.out.println("The series");
for(a=2;a<=n;a=a+3)
{
System.out.println(a);
}
}
Similar questions