is there a function to check if a number is even or odd?
thanks
even numbers and odd numbers
- Silvio.Falconi
- Posts: 7169
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 3 times
even numbers and odd numbers
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: even numbers and odd numbers
Code: Select all | Expand
function IsEvenNumber( n )
return ( ( n % 2 ) == 0 )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7169
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 3 times
Re: even numbers and odd numbers
nageswaragunupudi wrote:Code: Select all | Expand
function IsEvenNumber( n )
return ( ( n % 2 ) == 0 )
thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Re: even numbers and odd numbers
As old school programmer
Code: Select all | Expand
function IsEvenNumber( n )
return ( hb_bitand(n,1) == 0 )