Using the Sieve of Eratosthenes
algorithm, determine the prime numbers in [0, kN] as well as the number of primes and the max prime.
I've managed to get the prime numbers but I'm having issues getting the max. It keeps returning "1". If you can help me get the max prime number to print I'll be very grateful.
On lines 16 and 17: sieve[i] contains the primality of i. i is the number in question.
Also note that i will not reach past sqrt(userInput), but the sieve may contain some primes that are > sqrt(userInput) and <= userInput.