[try Beta version]
Not logged in

 
 
A void function that doesn't print?

Feb 28, 2014 at 9:42pm
I'm not exactly sure why, but the void function 'printTwinPrimes' does not print anything.

Last edited on Feb 28, 2014 at 11:39pm
Feb 28, 2014 at 9:58pm
1
2
3
4
5
   int i = start;
   int j = start + 1;
//...
			 i += 2;
			 j += 2;

j-i would always be 1
Feb 28, 2014 at 10:40pm
How? It's always incrementing at the end of the loop
Feb 28, 2014 at 11:36pm
You do set j to be i+1, so their difference cannot be 2.
You increment both variables by same amount, so their difference cannot change into 2.
Topic archived. No new replies allowed.