Menu
Question Index
...

Write a program to get the highest prime factor of a number.

Input(Number) Output(Number)
19 19
50 5
111 37



class HighestPrimeFactor
{
    public static void main(String s[])
    {
        int inputNumber = 209;
        int primeFactor = highestPrimeFactor(inputNumber);
        System.out.println("The factor is " + primeFactor);

    }


    public static int highestPrimeFactor(int input)
    {
    }
    public static boolean isPrime(int number)
    {
    }
    
    public static int[] getFactors(int number)
    {
    }

}

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App