Andrew_Levenson has asked for the wisdom of the Perl Monks concerning the following question:
If anyone wants to help me figure out what's wrong... just let me know what you did? Thanks.<code> use strict; use warnings; #finds prime numbers between two points; print "Please enter the values for the 2 numbers between which you wis +h to find the primes.\n"; $x=<STDIN>; chomp($x); print "\n"; #user inputs point x; $y=<STDIN>; chomp($y); print "\n"; #user inputs point y; for($i==$x; $i==$y; $i++){ $even=0; $notprime=0; $j=$i/2; if(int($j)==$j){ $even=1; # tests to see if it is even; } else{ $n=$i**(1/2); for($m=3; $m=$n; $m+=2){ $o=$i/$m; if(int($o)==$o){ $notprime=1; } } } if($even==0 && $prime==0){ print "$i is prime!\n"; } } $q=<STDIN>; # stops the program from closing...;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debugging?
by ikegami (Patriarch) on Mar 03, 2006 at 17:41 UTC | |
|
Re: Debugging?
by rinceWind (Monsignor) on Mar 03, 2006 at 17:37 UTC | |
|
Re: Debugging?
by runrig (Abbot) on Mar 03, 2006 at 17:39 UTC | |
|
Re: Debugging?
by zentara (Cardinal) on Mar 03, 2006 at 17:55 UTC | |
|
Re: Debugging?
by smthames (Initiate) on Mar 03, 2006 at 17:46 UTC |