Computers |
|
| | #1 (permalink) |
| Newb Techie Join Date: Oct 2007 Location: In a hole.
Posts: 26
| I've been playing with this program (it's my first) with Qbasic. It is supposed to calculate whether a number that the user puts in is a prime number. But now that I've gotten pretty far along on it I realize that I need to have it divide the user's number by all the prime numbers lower than its square root. To do this I would either need to have a list of lower prime numbers that it would divide by, or have it calculate all the low prime numbers (the goal of the program in the first place!) I don't know how to make Qbasic check the "divisibility" or if it even can. I've been trying to find it using google and all the Qbasic sites I can find. If you know how to make Qbasic check whether "X is divisible by Y" please let me know! Thanks for reading this post. EDIT: Urk! I just realized I'm in the sub-forum... Sorry if this isn't the place for this thread. Last edited by TheCorsairMalack; 11-26-2007 at 10:36 PM. Reason: Probably wrong forum... |
| | |
| | #2 (permalink) |
| Newb Techie Join Date: Oct 2007 Location: In a hole.
Posts: 26
| Whooohooooo!!!!! After a few hours of scratching a pencil in a calculus text book and messing around, I found out how to do it using step and absolute value [STEP, ABS()] Woot! I'm happy now. Kill this thread. |
| | |