Question:
Write a program that prints a series of prime numbers that end with 1.
Prompt the user for the first number (n1) and the last number(n2) in the series.
Print all possible prime numbers that ends with one from n1 to n2.
If n2 itself is prime, stop the series. Else print the nearest prime number that ends with one, next to n2.
Sample input:
Enter the first number
10
Enter the last number
100
Sample output:
11,31,41,61,71,101
CODE:–
Tags:
java interview programs for experienced | java interview programs for freshers pdf | java coding questions for 5 years experience | java programming interview questions – geeksforgeeks |
java programming interview questions and answers for freshers | java programs asked in interview for automation tester | java coding interview questions for experienced professionals
| java coding interview questions pdf | codechef | amazon | microsoft | google | 2021
ConversionConversion EmoticonEmoticon