Which generates prime numbers in their order, by unsignedshort which i mean to return that number from the order, for example, the first prime number is 2, so getprimen(1) which gets me 2, getprimen(2) which gets me 3, but everything past 3 is wrong and i dont know where is the problem, so, anyone can help me figure this out? Thanks in advance!
your logic makes no sense, but perhaps you're having troubles with the language, so write a pseudocode and we'll work from there.
and use meaningful names for your variables, ¿what's the purpose of `fnumber' and `cnumber'?
+ne555
ok, i'll do it will pseudocode, and variables such as "fnumber" (final number) and "cnumber" (counting number) are my way of writing temporary code.
> "fnumber" (final number) and "cnumber" (counting number)
number is not the important part, and you are not interested in simple numbers, but in those that are primes.
your naming is awful.
> Also fnumber/2 is probably supposed to be sqrt().
let's not worry about the efficency of wrong code, let's work on the logic first.