Menu
Question Index
...

Write a program to find whether the given numbers are Twin Primes.

Input (int, int) Output (boolean)
3, 5 true
7, 9 false
11, 13 true
29, 31 true
37, 41 false



class AreTwinPrimes
{
    public static void main(String s[])
    {
        System.out.println("The given numbers are Twin Primes : " + areTwinPrimes(17, 19));

    }


    public static boolean areTwinPrimes(int firstNumber, int secondNumber) {
    }
    

}

Doubts

Problems

Topic: 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