Menu
Question Index
...


Write a program to print the prime numbers in the given range. Spaces between numbers are important and all the numbers should be in the same line. Use System.out.println or System.out.print for printing.

Input (Integer, Integer) Printed Output
1, 10 2 3 5 7
10, 20 11 13 17 19

class PrintPrimeNumbers

{    public static void main(String s[])
    {
        printPrimeNumbers(30,40);

    }


public static void printPrimeNumbers(int startValue, int endValue)
{
//Write code here to print the prime numbers between the startValue and endValue. Use System.out.println or System.out.print for printing.
}
}

Doubts

Problems

Topic: Nested for Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App