From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 6: | Line 6: | ||
<b>Example</b><br> | <b>Example</b><br> | ||
<pre> | <pre> | ||
var | var | ||
| Line 16: | Line 16: | ||
if (Odd(i)) ShowMessage('Odd number :'+IntToStr(i)); | if (Odd(i)) ShowMessage('Odd number :'+IntToStr(i)); | ||
} | } | ||
</pre> | </pre> | ||
| Line 41: | Line 29: | ||
<h2> See Also </h2> | <h2> See Also </h2> | ||
* [[System_Library#Math_Functions | Math Functions]] | * [[System_Library#Math_Functions | Math Functions]] | ||
{{#seo:|title=Odd Using in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=The Odd function in Clomosy determines whether a given number is odd, providing a simple and efficient way to handle such checks in your application.}} | |||
Latest revision as of 11:56, 8 January 2025
function Odd(X: Integer): Boolean;
The Odd function returns true if the given Number is odd (remainder of 1 when divided by 2).
Example
var
i : Integer;
{
for (i = 1 to 9)
if (Odd(i)) ShowMessage('Odd number :'+IntToStr(i));
}
Output:
Odd number : 1
Odd number : 3
Odd number : 5
Odd number : 7
Odd number : 9