by goosfancito » Mon Apr 25, 2016 8:01 am
Hola.
Existe alguan funcion interna que te diga si es impar o par un numero?
(para no codificar una funcion)
gracias.
-
goosfancito
-
- Posts: 1954
- Joined: Fri Oct 07, 2005 7:08 pm
by AngelSalom » Mon Apr 25, 2016 9:25 am
Esto te puede valer :
- Code: Select all Expand view
If Int(nNumero/2)=nNumero/2
Para probar :
- Code: Select all Expand view
#include "fivewin.ch"
Function Main()
Local nNumero:=24
If Int(nNumero/2)=nNumero/2
msginfo ('par')
else
msginfo ('impar')
endif
Return (nil)
Angel Salom
Visionwin Software -
https://www.visionwin.com------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
-
AngelSalom
-
- Posts: 727
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Benicarló (Castellón ) - España
-
by goosfancito » Mon Apr 25, 2016 11:22 am
gracias a ambos dos!
pense que habia una funcion interna, ya estoy usando ese metodo.
-
goosfancito
-
- Posts: 1954
- Joined: Fri Oct 07, 2005 7:08 pm
Return to FiveWin para Harbour/xHarbour
Who is online
Users browsing this forum: Google [Bot], Horizon and 92 guests