mattias1975
Programmer
Is there any function in c that decides if a number is devidable with 2 or not?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int n;
if (n&1) /* if is odd... */
...
if (n&1 == 0) /* if is even... */
... /* or */
if (n%2 == 0) /* for purists only... */
...
#define iseven(n) ((n)%2==0)
...
if (iseven(n))
...