Computer Science, asked by deepikakrishnan572, 2 months ago

t :
Write a program to print the nth prime number after a given number
8
Example 1: Given prime number m=3 and n-5. The program should
Given input
3
5
Expected output
17
Example 2
Given input
7
10
Expected output
43​

Answers

Answered by chuttijames
0

Explanation:

import java.util.Scanner;

public class NthPrimeNumberExample.

{

public static void main(String[] args)

{

//constructor of the Scanner class.

Scanner sc = new Scanner(System.in);

System.out.print("Enter the value of n to compute the nth prime number: ");

Similar questions