What I have done is to ask the user to input a particular number and check if it is prime or not. Now I want to display the prime numbers between 0 to 1000, but I can't make it work.
btw i%j == 0 is not the best way to check prim numbers.
e.g. if x % 2 != 0 and x % 3 != 0, x % 6 will also be != 0
but you can think about that once it's working
Could write up a quick sieve. Array of bool, set all to be true at first. Change each number divisible by 2 and greater than 2 to be false. Go to three, is it prime? If yes, leave true and set all multiples of 3 to be false. If no, set to false. Find next true element, this is prime. Mark all multiples of this to be false. Continue this until there's no more unmarked spots to move forward to.