I need to find the highest prime number in a given range.
Here is my code which works for 0-100 but if I give 0-125 it is showing prime number as 125.
<
The simplest method you can use is dividing a number starting from 3 with an Array filled by a 2, if modulus (%) gives you an an answer else than 0, it's prime. Then after you got a working code think what can I make better ?
Try to apply these on your code, or just google a working version.