#so i was instructed to find if random is prime or not...
1 messages · Page 1 of 1 (latest)
so ? what did you do ?
bro that's ez 5 min max but what did you try
Well figure out what the base cases would be.
Once you know the base cases it really only takes a very short and simple couple lines of codes. Think what a prime number can't do that a non-prime can do.
once you figure out what seperates them it should click pretty quick
If you can't figure it out I'll put a spoiler that will lead you in the right direction but you should try and figure it out for yourself as this is really basic and just requires you to sit down and think for a bit. If you can't get this it's only going to get exponentially harder.
||A Prime number cannot be divisible by any number between 1 and itself, let's say the number is n the range for it would be 2,n-1 which is what it cannot be divided by||