How to resolve the algorithm Even or odd step by step in the XLISP programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Even or odd step by step in the XLISP programming language
Table of Contents
Problem Statement
Test whether an integer is even or odd. There is more than one way to solve this task:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Even or odd step by step in the XLISP programming language
Source code in the xlisp programming language
(defun my-evenp (x)
(= (logand x 1) 0) )
(defun my-oddp (x)
(/= (logand x 1) 0) )
You may also check:How to resolve the algorithm Read entire file step by step in the Ol programming language
You may also check:How to resolve the algorithm Pseudo-random numbers/Combined recursive generator MRG32k3a step by step in the Ruby programming language
You may also check:How to resolve the algorithm Sum digits of an integer step by step in the Befunge programming language
You may also check:How to resolve the algorithm Substring/Top and tail step by step in the Forth programming language
You may also check:How to resolve the algorithm Reflection/List methods step by step in the Ring programming language