NDiggity
- 53
- 0
Homework Statement
The problem is to find all the prime numbers between one and one-hundred and print them out in pseudocode.
Here is my attempt. The problem is that when it's false, isPrime will be false but when it tries to divide by the next number and it is true, it makes isPrime true. I'm not sure how to fix this. Help!
bool isPrime <-- true
int i
int j
for i <-- 1 to 100
for j <--2 to 10
if (i=1)
continue
if (i =2)
print i
continue
if (i = j)
continue
if (i % j != 0 AND i!=j)
isPrime= true
if (i % j = 0)
isPrime = false
if (isPrime = true)
print i