The information in this article applies to:
SUMMARYThere is no single function in FoxPro or Visual FoxPro that determines whether a number is prime. This article describes how to use a program that allows you to enter a positive number and then reports if that number is prime. MORE INFORMATIONA prime number is a number divisible only by one and itself. The following program uses the MOD()and ABS() functions along with a For...Next loop to check if a number is prime:
While this program uses the READ statement for backward compatibility with
FoxPro 2.x versions, the basic algorithm may be used in a form within
Visual FoxPro.
Additional query words: VFoxWin VFoxMac
Keywords : FxprgGeneral |
Last Reviewed: December 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |