JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*Enter 2 numbers.
The First one is the number to start the series.
The second one specifies the number of prime numbers you want.
*/
//Thanks to Ace for Feedback.
import java.util.*;
public class primeSeries
{
public static void main(String[] args)
{
Scanner in= new Scanner(System.in);
int n,t,i=0,j,test;
try
{
System.out.println("Enter the number to start the series");
n=in.nextInt();
System.out.println("Enter the number of terms in the series");
t=in.nextInt();
}
catch(Exception e)
{
n=1;
t=10;
System.out.println("Default Values applied.");
}
n++;
while(i<t)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run