[Question]
  [
> 
> *Note: There is not been a vanilla parity test challenge yet (There is a C/C++ one but that disallows the ability to use languages other than C/C++, and other non-vanilla ones are mostly closed too), So I am posting one.*
> 
> 
> 
Given a positive integer, output its parity (i.e. if the number is odd or even) in truthy/falsy values. You may choose whether truthy results correspond to odd or even inputs.
---
# Examples
Assuming True/False as even and odd (This is not required, You may use other Truthy/Falsy values for each), responsively:
```
(Input):(Output)
1:False
2:True
16384:True
99999999:False
```
# Leaderboard
```
var QUESTION_ID=113448,OVERRIDE_USER=64499;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){var F=function(a){return a.lang.replace(/<\/?a.*?>/g,"").toLowerCase()},el=F(e),sl=F(s);return el>sl?1:el<sl?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# [ArnoldC](https://lhartikk.github.io/ArnoldC/), ~~299~~ 283 bytes
```
IT'S SHOWTIME
HEY CHRISTMAS TREE i
YOU SET US UP 0
GET YOUR ASS TO MARS i
DO IT NOW
I WANT TO ASK YOU A BUNCH OF QUESTIONS AND I WANT TO HAVE THEM ANSWERED IMMEDIATELY
GET TO THE CHOPPER i
HERE IS MY INVITATION i
I LET HIM GO 2
ENOUGH TALK
TALK TO THE HAND i
YOU HAVE BEEN TERMINATED
```
This outputs `1` (which is truthy) for odd input and `0` (which is falsy) for even input.
[**Try it online!**](https://tio.run/nexus/arnoldc#RY9RbsNACET/9xTz19@qUg9AYmpQvIu7sLF8hN7/AA5OFeUHoZknZjg0PhwutoVWLsI7rtLVo5IjOjP@ym4DzoHhGCs@y5x7ah3kyRgqdU9sMmig2VYUG7U4LfLbiYJwGe0qsB/8DvZQaw5qE96o0J0RwjV137hzmrXypBS87M/QpBLIgrau3DNSEoM66g5tdw06D6euWBIXrZgNX4WbjVkQtNzKOV6H5Gzw/98z/cLcENyrtgydjuP7eAA "ArnoldC – TIO Nexus")
## “[Now this is the plan](https://www.youtube.com/watch?v=dAX2H0hpOc4&feature=youtu.be)” (An attempt at an explanation)
The code reads the input into variable `i`, replaces it with the result of modulo 2, and then prints it.
```
IT'S SHOWTIME                                    # BeginMain
HEY CHRISTMAS TREE i                             #   Declare i
YOU SET US UP 0                                  #   SetInitialValue 0
GET YOUR ASS TO MARS i                           #   AssignVariableFromMethodCall i
DO IT NOW                                        #   CallMethod
I WANT TO ASK YOU ... ANSWERED IMMEDIATELY       #   ReadInteger
GET TO THE CHOPPER i                             #   AssignVariable i
HERE IS MY INVITATION i                          #     SetValue i (push i on the stack)
I LET HIM GO 2                                   #     ModuloOperator 2
ENOUGH TALK                                      #   EndAssignVariable
TALK TO THE HAND i                               #   Print i
YOU HAVE BEEN TERMINATED                         # EndMain
```
[Answer]
# [brainfuck](https://github.com/TryItOnline/tio-transpilers), 8 bytes
```
+[,>,]<.
```
Input is in unary. Output is the **1** (truthy) for odd numbers and **NUL** (falsy) for even numbers.
[Try it online!](https://tio.run/nexus/brainfuck#@68drWOnE2uj9/@/IQgAAA "brainfuck – TIO Nexus")
### How it works
We start by incrementing the current cell with `+` to be able to enter the while loop `[,>,]`.
In each iteration, `,` reads a byte from STDIN, `>` advances to the cell to the right, then `,` reads another byte from STDIN. When input is exhausted, the interpreter (the one on TIO, anyway) will set the cell to **NUL** instead. Once that happens, the condition of the while loop is no longer fulfilled and we break out of it.
Let **n** be the input integer. If there is an even amount of input bytes – i.e., if **n** is even – the first **n/2** iterations will read two **1**'s, and the next iteration will read two **NUL**'s, leaving the tape as follows.
```
...   1  NUL  NUL
...  49    0    0
                ^
```
`<.` retrocedes one cell and prints its content, sending a **NUL** byte to STDOUT.
However, if there is an odd amount of input bytes, the first **(n - 1)/2** iterations will read two **1**'s, and the next iteration will read one **1** and one **NUL**, leaving the tape as follows.
```
...   1    1  NUL
...  49   49    0
                ^
```
`<` will now retrocede to a cell holding the byte/character **1**, which `.` prints.
[Answer]
## Mathematica, 4 bytes
```
OddQ
```
Gives `True` for odd inputs and `False` for even inputs, who knew?
There's also `EvenQ`, but who would want to type all of that?
[Answer]
# [Taxi](https://bigzaphod.github.io/Taxi/), ~~1,482~~ ~~1,290~~ ~~1,063~~ ~~1,029~~ 1,009 bytes
I've never written a program in Taxi before and I'm a novice in programming for general, so there are probably better ways to go about this. I've checked for errors and managed to golf it a bit by trying different routes that have the same result. I welcome any and all revision.
Returns `0` for even and `1` for odd.
```
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Divide and Conquer.2 is waiting at Starchild Numerology.Go to Starchild Numerology:n 1 l 1 l 1 l 2 l.Pickup a passenger going to Divide and Conquer.Go to Divide and Conquer:e 1 l 2 r 3 r 2 r 1 r.Pickup a passenger going to Cyclone.Go to Cyclone:e 1 l 1 l 2 l.Pickup a passenger going to Trunkers.Pickup a passenger going to Equal's Corner.Go to Trunkers:s 1 l.Pickup a passenger going to Equal's Corner.Go to Equal's Corner:w 1 l.Switch to plan "b" if no one is waiting.Pickup a passenger going to Knots Landing.Go to Knots Landing:n 4 r 1 r 2 r 1 l.[a]Pickup a passenger going to The Babelfishery.Go to The Babelfishery:w 1 l.Pickup a passenger going to Post Office.Go to Post Office:n 1 l 1 r.[b]0 is waiting at Starchild Numerology.Go to Starchild Numerology:n 1 r.Pickup a passenger going to Knots Landing.Go to Knots Landing:w 1 r 2 r 1 r 2 l 5 r.Switch to plan "a".
```
[Try it online!](https://tio.run/nexus/taxi#rVNLT8MwDP4rVi/cItYNhHpkIA4gmLTdph3S1m2jhaRLUqr9@pKQdNpLHYgdLCt@fLY/O92LBCNhJrWBj6JgGSYtjIBbUU6TGcvWTQ0Uaqo1ihIVlJKJ0mUtKoRHmiIvmK5QbYkHOzYnukccRHtiXyxHoCKHqRSbBhWJgWloKTMuhBqYG6qyivEc3ptPVJLLsi96zpWIUNhLfGGcMw147FNHggFRwdhK/EPW8HjTbcalwAAZXgHnN90tVCPWqPRg0POmofxG2zaV2LXfZ/o9/D3/0Ojvg8xbZrLKuWtOBURpBKwAIcFOtbe1wWqvQhoNb5ZXF@mLHdjsAiee2kAxJ0u6usZJthep2PsS5PSTiN1JL9PV7RXOVP2TqXaPJac53FnM4y3RiHTd6H78MPkG)
You're right, that's awful to read without line breaks. Here's a formatted version:
```
Go to Post Office:w 1 l 1 r 1 l.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery:s 1 l 1 r.
Pickup a passenger going to Divide and Conquer.
2 is waiting at Starchild Numerology.
Go to Starchild Numerology:n 1 l 1 l 1 l 2 l.
Pickup a passenger going to Divide and Conquer.
Go to Divide and Conquer:e 1 l 2 r 3 r 2 r 1 r.
Pickup a passenger going to Cyclone.
Go to Cyclone:e 1 l 1 l 2 l.
Pickup a passenger going to Trunkers.
Pickup a passenger going to Equal's Corner.
Go to Trunkers:s 1 l.
Pickup a passenger going to Equal's Corner.
Go to Equal's Corner:w 1 l.
Switch to plan "b" if no one is waiting.
Pickup a passenger going to Knots Landing.
Go to Knots Landing:n 4 r 1 r 2 r 1 l.
[a]Pickup a passenger going to The Babelfishery.
Go to The Babelfishery:w 1 l.
Pickup a passenger going to Post Office.
Go to Post Office:n 1 l 1 r.
[b]0 is waiting at Starchild Numerology.
Go to Starchild Numerology:n 1 r.
Pickup a passenger going to Knots Landing.
Go to Knots Landing:w 1 r 2 r 1 r 2 l 5 r.
Switch to plan "a".
```
Here's my best attempt to explain the logic:
```
Go to Post Office to pick up the stdin value in a string format.
Go to The Babelfishery to convert the string to a number.
Go to Starchild Numerology to pickup the numerical input 2.
Go to Divide and Conquer to divide the two passengers (stdin & 2).
Go to Cyclone to create a copy of the result.
Go to Trunkers to truncate the original to an integer.
Go to Equal's Corner to see if the two passengers are the same.
Equal's Corner returns the first passenger if they're the same (no .5 removal so the stdin was even) or nothing if they're not.
If nothing was returned, it was odd, so go pick up a 0 from Starchild Numerology.
Go to Knots Landing to convert any 0s to 1s and all other numbers to 0s.
Go to The Babelfishery to convert the passenger (either a 1 or 0 at this point) to a string.
Go to Post Office to print that string.
Try and fail to go to Starchild Numerology because the directions are wrong so the program terminates.
```
Not going back to the Taxi Garage causes output to STDERR but I'm [fine with that](https://codegolf.meta.stackexchange.com/questions/4780/should-submissions-be-allowed-to-exit-with-an-error/4781#4781).
[Answer]
# Python, ~~11~~ 10 bytes
-1 byte thanks to Griffin
```
1 .__and__
```
[Try it online!](https://tio.run/nexus/python2#S7ON@W@ooBcfn5iXEh//Py2/SCFTITNPoSgxLz1Vw9BA04pLoaAoM69EIVNHIU0jU/M/AA "Python 2 – TIO Nexus")  
Using bitwise `and`, returns `0` for even and `1` for odd
[Answer]
## [Retina](https://github.com/m-ender/retina), 8 bytes
```
[02468]$
```
A Retina answer for decimal input. This is also a plain regex solution that works in almost any regex flavour. Matches (and prints `1`) for even inputs and doesn't match (and prints `0`) for odd inputs.
[Try it online!](https://tio.run/nexus/retina#U9VwT/gfbWBkYmYRq/L/vyGXEZehmbGFCZclFAAA "Retina – TIO Nexus")
An alternative, also for 8 bytes, uses a transliteration stage to turn all even digits to `x` first (because transliteration stages have a built-in for even/odd digits):
```
T`E`x
x$
```
Of course, the shortest input format (even [shorter than unary](https://codegolf.stackexchange.com/a/113458/8478)) would be binary in this case, where a simple regex of `0$` would suffice. But since the challenge is essentially about finding the least-signficant binary digit, binary input seems to circumvent the actual challenge.
[Answer]
## LOLCODE, 67 bytes
```
HOW DUZ I C YR N
  VISIBLE BOTH SAEM MOD OF N AN 2 AN 0
IF U SAY SO
```
Function that returns `WIN` (true) if number is even, else (odd) it will return `FAIL` (false).
Call with `C"123"`.
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~5~~ 3 bytes
*Because builtins are boring*
```
:He
```
This outputs a matrix of nonzero values (which is truthy) for even input, and a matrix with a zero in its lower right entry (which is falsy) for odd input.
[**Try it online!**](https://tio.run/nexus/matl#@2/lkfrfXr2kqLQko1K9Vj0tMae4Uv2/KQA "MATL – TIO Nexus") The footer code is an `if-else` branch to illustrate the truthiness or falsihood of the result. Removing that footer will implicitly display the matrix.
### Explanation
Consider input `5` as an example
```
:     % Implicitly input n. Push row vector [1 2 ... n]
      % STACK: [1 2 3 4 5]
He    % Reshape into a 2-row matrix, padding with zeros if needed
      % STACK: [1 3 5;
                2 4 0]
```
[Answer]
# Java 8, 8 bytes
```
n->n%2<1
```
[Try it here.](https://tio.run/nexus/java-openjdk#hY/BCsIwEETv/Yq5CMnBQquI0uofeCg9ioc0Rgmkm7ZJBZF@e021V@keFmbfMMNKI5zDWWh6R4Amr7q7kArFJIHKWqMEQbKAQDwL1yEKy3nhtUSBFkeMtD7RKs2TMZtY01cmsNnytPqGOhSw0neaHpcrBP@lly/nVR3b3sdNQN4Qa2PJEv7t@cvTBZ7sNvvtgucwD59fGsYP)
# Java 7, 30 bytes
```
Object c(int n){return n%2<1;}
```
[Try it here.](https://tio.run/nexus/java-openjdk#hYqxCsIwFEX3fsVdhGQptIoo1U8IDh3FIY1BIs1raV4VCf32GtTZnuXCPce0OgSoOJ@auzUMIxwxSMbB8jgQaFUeimqagX5sWmcQWHOaR@eu8NqRqHlwdDtfoGXMkFDwOILsE0rI6nPVr8DW593IeZ9qbkn43IhC/vflgi@2691modn/@GZTNs1v)
Outputs `true` for even numbers and `false` for odd numbers
---
If `1/0` would be allowed instead of `true/false` ([it isn't, considering the numbers of votes here](https://codegolf.meta.stackexchange.com/a/2194/52210)):
* **Java 8 (6 bytes):** `n->n%2`
* **Java 7 (25 bytes):** `int c(int n){return n%2;}`
[Answer]
# Piet, 15 codels / 16 bytes
[![Source Code](https://i.stack.imgur.com/9aDlj.png)](https://i.stack.imgur.com/9aDlj.png)
```
5njaampjhompppam
```
[Online interpreter available here.](http://zobier.net/piet/)
This program returns 0 if the input is even and 1 if the input is odd.
The text above represents the image. You can generate the image by pasting it into the text box on the interpreter page. For convenience I have provided the image below where the codel size is 31 pixels. The grid is there for readability and is not a part of the program.
## Explanation
This program uses the modulo builtin to determine if the input is even or odd.
```
Instruction    Δ Hue   Δ Lightness   Stack
------------   -----   -----------   -------
In (Number)    4       2             n
Push [2]       0       1             2, n
Modulo         2       1             n % 2
Out (Number)   5       1             [Empty]
[Exit]         [N/A]   [N/A]         [Empty]
```
The dark blue codels in the bottom-left are never visited and can be changed to any color other than a color of a neighboring codel. I chose dark blue as I think it looks nice with the rest of the program. The top-left black codel could also be white, but not any other color. I have chosen black as I think it looks nicer.
I have provided the program in both image form and text form as there is no clear consensus on how to score Piet programs. Feel free to weigh in on [the meta discussion.](https://codegolf.meta.stackexchange.com/questions/10991/how-to-determine-the-length-of-a-piet-program)
[Answer]
# [brainfuck](https://github.com/TryItOnline/tio-transpilers), 14 bytes
Input and output is taken as character codes as per [this meta](https://codegolf.meta.stackexchange.com/a/4719/47066).  
Byte value 1 correspond to odd numbers and 0 to even.
```
+>>,[-[->]<]<.
```
[Try it online!](https://tio.run/nexus/brainfuck#@69tZ6cTrRutaxdrE2uj9/@/IgA "brainfuck – TIO Nexus")
[Answer]
# JavaScript, 6 bytes
An anonymous function:
```
n=>n&1
```
Alternatively with the same length:
```
n=>n%2
```
Both will return `0|1` which should fulfill the requirement for `truthy|falsey` values.
[Try both versions online](https://jsfiddle.net/fs10nga8/)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 1 byte
```
v
```
Returns `1` for even numbers, `0` for odd.
[Try it online!](https://tio.run/nexus/japt#@1/2/7@hkbEJAA "Japt – TIO Nexus")
### Explanation
One of Japt's defining features is that unlike most golfing languages, functions do not have fixed arity; that is, any function can accept any number of arguments. This means that you can sometimes leave out arguments and Japt will guess what you want. `v` on numbers is a function that accepts one argument and returns `1` if the number is divisible by the argument, else `0`. For example:
```
v3
```
This program will output `1` if the input is divisible by 3, and `0` otherwise. It just so happens that the default argument is `2`, thereby solving this challenge in a single byte.
---
## Alternative 1 byte solution:
```
¢
```
`¢` converts the input into a base-2 string. The `-h` flag returns the last char from the string.
[Try it online!](https://tio.run/nexus/japt#@39o0f//hkbGJqZcuhkA)
[Answer]
# Sinclair ZX81 BASIC 124 bytes 114 bytes 109 bytes 57 50 42 tokenized BASIC bytes
Another release candidate:
```
 1 INPUT A
 2 IF A THEN PRINT A;":";NOT INT A-(INT (INT A/VAL "2")*VAL "2")
```
As per Adám's comments below:
```
 1 INPUT A
 2 IF NOT A THEN STOP
 3 PRINT A;":";NOT INT A-(INT (INT A/VAL "2")*VAL "2")
```
It will now `PRINT` `1` for even and `0` for odd. Zero exits.
Here are older versions of the symbolic listing for reference purposes:
```
 1 INPUT A
 2 IF NOT A THEN STOP
 3 LET B=INT (INT A/2)
 4 PRINT A;":";NOT INT A-B*2
 5 RUN
```
Here is the old (v0.01) listing so that you may see the improvements that I've made as not only is this new listing smaller, but it's faster:
```
 1 INPUT A
 2 IF A<1 THEN STOP
 3 LET B=INT (INT A/2)
 4 LET M=1+INT A-B*2
 5 PRINT A;":";
 6 GOSUB M*10
 7 RUN
10 PRINT "TRUE"
11 RETURN
20 PRINT "FALSE"
21 RETURN
```
And here is v0.02 (using Sinclair sub strings):
```
 1 INPUT A
 2 IF NOT A THEN STOP
 3 LET B=INT (INT A/2)
 4 LET M=1+INT A-B*2
 5 LET C=4*(M=2)
 6 PRINT A;":";"TRUE FALSE"(M+C TO 5+C+(M=2))
 7 RUN
```
[![ZX81 in action - true or false from v1/2](https://i.stack.imgur.com/K5QvO.png)](https://i.stack.imgur.com/K5QvO.png)
[Answer]
# [brainfuck](https://github.com/TryItOnline/tio-transpilers), 12 bytes
```
,++[>++]>++.
```
This requires an interpreter with a circular tape and cells that wrap around. The one on TIO has 65,536 8-bit cells and satisfies the requirements.
I/O is in bytes. Odd inputs map to **0x00** (falsy), even inputs to a non-zero byte (truthy).
[Try it online!](https://tio.run/nexus/bash#TY67CsIwAEVn8xWX0hIlNrWVTpZuuvoB6pA@AkFJQppCxPrttYOIw4HLuctphUcNK5zyT95IVBXo8Xyi85axS83YbYHPiyFEGgcNpfHKOS/K8n1AZ8jKOqW9BE32Iyhi/TPRNcTr7052RVi@TYQJmbE@88qk3gk9WPXo3ZA1Tigtx/b@1zIhhA6pHUhndD9/AA "Bash – TIO Nexus")
### How it works
We start by reading a byte of input with `,` and adding **2** to its value with `++`. We'll see later why incrementing is necessary.
Next, we enter a loop that advances to the cell at the right, add **2** to it, and repeats the process unless this set the value of the cell to **0**.
Initially, all cells except for the input cell hold **0**. If the input is odd, adding **2** to it will never zero it out. However, after looping around the tape **127** times, the next iteration of the loop will set the cell to the right of the input cell to **128 × 2 = 0 (mod 256)**, causing the loop to end. `>++` repeats the loop body one more time, so next cell is also zeroed out and then printed with `.`.
On the other hand, if the input is **n** and **n** is even, the code before the loop sets the input cell to **n + 2**. After looping around the tape **(256 - (n - 2)) / 2 = (254 - n) / 2** times, the input cell will reach **0**, and the cell to its right will hold the value **(254 - n) / 2 × 2 = 254 - n**. After adding **2** with `>++`, `.` will print **256 - n = -n (mod 256)**, which is non-zero since **n** is non-zero.
Finally, note that the second case would print **258 - n = 2 - n (mod n)** if we didn't increment the input before the loop, since one more loop around the tape would be required to zero out the input cell. The program would thus fail for input **2**.
[Answer]
# [Intel 8080 machine code](https://en.wikipedia.org/wiki/Intel_8080), 1 byte
```
1F      RAR     ; rotate accumulator's least significant bit into Carry Flag
```
Input is in `A`, result is `CF=1` if odd, `CF=0` if even.
Here is a test program for the [MITS Altair 8800](https://en.wikipedia.org/wiki/Altair_8800) that will take the input number and display the result (odd or even) on the front panel lights. Just follow these programming instructions on the front panel switches:
```
Step    Switches 0-7    Control Switch  Instruction Comment
1                       RESET
2       00 111 110      DEPOSIT         MVI  A, 27  Load number to examine into A
3       00 011 011      DEPOSIT NEXT                Set value to test (27 in this case)
4       00 011 111      DEPOSIT NEXT    RAR         Rotate A's LSB into CF
5       11 110 101      DEPOSIT NEXT    PUSH PSW    Push Status Flags to stack
6       11 000 001      DEPOSIT NEXT    POP  B      Pop Status Flags to BC register
7       00 111 110      DEPOSIT NEXT    MVI  A, 1   CF is LSB (0x1) of Status Flags
8       00 000 001      DEPOSIT NEXT
9       10 100 001      DEPOSIT NEXT    ANA  C      Mask CF so is only result displayed
10      11 010 011      DEPOSIT NEXT    OUT  255    display contents of A on data panel
11      11 111 111      DEPOSIT NEXT
12      01 110 110      DEPOSIT NEXT    HLT         Halt CPU
13                      RESET                       Reset program counter to beginning
14                      RUN
15                      STOP
                                                    D0 light will be on if value is odd,
                                                    or off if even
```
If entered correctly, the program in RAM will look like: `0000 3e 1b 1f f5 c1 3e 01 a1 d3 ff 76`
To re-run with a another number:
```
Step    Switches 0-7    Control Switch      Comment
1                       RESET
2       00 000 001      EXAMINE             Select memory address containing value
3       00 000 010      DEPOSIT             Enter new value in binary (2 in this case)
4                       RESET
5                       RUN
6                       STOP
```
[Try it online!](https://s2js.com/altair/sim.html)
Just follow the easy steps above!
**Output**
Input = `27`, light `D0` is ON indicating ODD result:
[![enter image description here](https://i.stack.imgur.com/wSqMI.png)](https://i.stack.imgur.com/wSqMI.png)
Input = `2`, light `D0` is OFF indicating EVEN result:
[![enter image description here](https://i.stack.imgur.com/FTrEX.png)](https://i.stack.imgur.com/FTrEX.png)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 1 byte
```
È
```
Fairly self-explantory. Returns `a % 2 == 0`
[Try it online!](https://tio.run/nexus/05ab1e#@3@44/9/QwA "05AB1E – TIO Nexus")
[Answer]
# Pyth, ~~3~~ 2 bytes
I did it. I golfed the ungolfable. For once, it's a non-trivial solution that managed to get that last byte!
```
!F
```
Truthy on even values (not including 0, but that's not positive so...).
Explanation:
```
!    Not
 FQQ Applied to the input (first Q) Q times
```
For example, `!!2 = !0 = 1`, and `!!!3 = !!0 = !1 = 0`
I'll keep my library of 3-byte solutions here below.
"There's another answer with multiple 3-byte solutions, but it's far from complete. Let's add a couple more:
```
@U2
```
Indexes into the list `[0,1]` modularly, giving truthy values on odd input.
```
}2P
```
Is 2 in the prime factorization of the input? (Truthy on even)
```
ti2
```
Is the GCD of 2 and the input 2? (Truthy on even)
```
gx1
```
does XOR-ing the input with 1 not decrease it? (Truthy on even)
```
q_F
```
Basically `Q == Q*-1^Q` where Q is the input, but done through a loop. (Truthy on even)
```
_FI
```
Same as above.
```
g^_
```
Translates to `Q <= -Q^Q` (Truthy on even)
Note that any of the above solutions involving `g` will work with `<` for flipped truthy-falsiness.)
[Answer]
# [BitCycle](https://github.com/dloscutoff/esolangs/tree/master/BitCycle), ~~19 17 16~~ 15 bytes
```
?ABv
 // <
!+\<
```
[Try it online!](https://tio.run/##S8osSa5Mzkn9/9/e0amMS0FfX8GGS1E7xub///@GBgb/8gtKMvPziv/rlgIA "BitCycle – Try It Online")
~~Argh, I feel like there's a 18 byte solution floating just out of reach :(~~ Haha! -2 bytes by using a `+` to redirect bits coming from different directions. 
### Explanation:
```
?ABv   Feed unary input into the main loop
 /     Every loop, two bits will be removed from the input
 +\<   By the \ and /s each
```
```
       When we reach the point where there is either one or no bits of input left
 // <  If one, it will reflect off all three /\s and turn west at the +
!+\    And then output, otherwise the program ends since no more bits are moving
```
[Answer]
## Retina, 3 bytes
```
11
```
The trailing newline is significant. Takes input in unary. Outputs 1 for odd numbers, nothing for even numbers. [Try it online!](https://tio.run/nexus/retina#@29oyPX/vyEUAAA "Retina – TIO Nexus")
[Answer]
# C++, 25 bytes
```
template<int v>int o=v&1;
```
This defines a variable template ([a function-like construct](https://codegolf.meta.stackexchange.com/a/2422)) with value equal to the bitwise operation `input&1`. `0` for even values, `1` for odd values. The value is calculated on compile-time.
Requires C++14.
[Try it online!](http://coliru.stacked-crooked.com/a/9f60d4a37ec0facd)
[Answer]
# TIS-100, 39 bytes
Of course, this is, more precisely, a program for the T21 Basic Execution Node architecture, as emulated by the TIS-100 emulator. 
I'll refer you to [this answer](https://codegolf.stackexchange.com/a/60264/64834) for a fantastically in-depth explanation of the scoring for TIS-100 programs, as well as their structure.
```
@0
ADD UP
G:SUB 2
JGZ G
MOV ACC ANY
```
Explanation:
```
@0          # Indicates that this is node 0
ADD UP      # Gets input and adds it to ACC, the only addressable register in a T-21
G:          # Defines a label called "G"
SUB 2       # Subtracts 2 from ACC
JGZ G       # If ACC is greater than 0, jumps to G
MOV ACC ANY # Sends the value of ACC to the first available neighbor; in this case, output.
            # Implicitly jumps back to the first line
```
In pseudocode, it'd look something like:
```
while (true) {
    acc = getIntInput()
    do {
        acc -= 2
    } while (acc > 0)
    print(acc)
}
```
The T21 doesn't have boolean types or truthy/falsy values, so the program returns -1 for odd numbers and 0 for even numbers, unless the previous input was odd, in which case it returns -1 for even numbers and 0 for odd numbers - if that fact disturbs you, this is a full-program answer, so you can just restart your T21 between uses.
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~22~~ 20 bytes
[*Here is annother cool answer in Brain-Flak you should also check out*](https://codegolf.stackexchange.com/a/113488/56656)
```
(({})){({}[()]<>)}<>
```
[Try it online!](https://tio.run/nexus/brain-flak#@6@hUV2rqVkNJKM1NGNt7DRrbez@/zcCAA "Brain-Flak – TIO Nexus")
## Explanation
To start we will make a copy of our input with `(({}))`.
The bottom copy will serve as a truthy value while the top one will be used for the actual processing. This is done because we need the input to be on the top and it is rather cumbersome (two extra bytes!) to put a 1 underneath the input.
Then we begin a loop `{({}[()]<>)}`. This is a simple modification on the standard countdown loop that switches stacks each time it decrements.
Since there are two stacks an even number will end up on the top of the stack it started on while an odd number will end on the opposite stack. The copied value will remain in place and thus will act as a marker of where we started.
Once we are done with the loop we have a `0` (originally the input) sitting on top of either a truthy (the copy of the input) or falsy (empty stack) value. We also have the opposite value on the other stack.
We need to get rid of the `0` which can be removed either by `{}` or `<>`. Both seem to work and give opposite results, however `{}` causes a falsy value for zero, when it should return truthy. This is because our "truthy" value is a copy of the input and zero is the only input that can be falsy.
This problem is resolved by ending the program with `<>` instead.
(Of course according to the specification I do not technically have to support zero but give two options I would prefer to support it)
[Answer]
## C#, 8 bytes
```
n=>n%2<1
```
Compiles to a `Func<int, bool>`.
Or if an anonymous function is disallowed, this method for 21 bytes:
```
bool p(int n)=>n%2<1;
```
[Answer]
# Pyth, 3
I was expecting pyth to have a 1 or 2 byte builtin for this. Instead here are the best solutions I could find:
```
%Q2
```
or
```
.&1
```
or
```
e.B
```
[Answer]
# Bash + bc, 21 14 11 9 bytes
```
bc<<<$1%2
```
Reads command-line input, expands the value into the string with the mod operation, and pipes the string to bc for calculation. Outputs 1 for odd, 0 for even.
Test cases:
```
(Input):(Output)
1:1
2:0
16384:0
99999999:1
```
Edit: saved 7 bytes thanks to @ais523  
Edit 2: saved another 3 bytes thanks to @Dennis  
Edit 3: saved another two thanks to @Dennis
[Answer]
# [7](https://esolangs.org/wiki/7), 18 characters, 7 bytes
```
177407770236713353
```
[Try it online!](https://tio.run/nexus/7#@29obm5iYG5ubmBkbGZuaGxsavz/v6EhAA "7 – TIO Nexus")
7 doesn't have anything resembling a normal if statement, and has more than one idiomatic way to represent a boolean. As such, it's hard to know what counts as truthy and falsey, but this program uses `1` for odd and the null string for even (the truthy and falsey values for Perl, in which the 7 interpreter is written). (It's easy enough to change this; the odd output is specified before the first 7, the even output is specified between the first two 7s. It might potentially need an output format change to handle other types of output, though; I used the two shortest distinct outputs here.)
7 uses a compressed octal encoding in which three bytes of source represent eight bytes of program, so 18 characters of source are represented in 7 bytes on disk.
## Explanation
```
177407770236713353
 77  77     7       Separate the initial stack into six pieces (between the 7s)
        023         Output format string for "output integers; input one integer"
       7   6        Escape the format string, so that it's interpreted as is
             13     Suppress implicit looping
               3    Output the format string (produces input)
                5   Run the following code a number of times equal to the input:
   40                 Swap the top two stack elements, escaping the top one
                 3  Output the top stack element
```
Like many output formats, "output integers" undoes any number of levels of escaping before outputting; thus `40`, which combined make a swap-and-escape operation, can be used in place of `405`, a swap operation (which is a swap-and-escape followed by an unescape). If you were using an output format that isn't stable with respect to escaping, you'd need the full `405` there. (Incidentally, the reason why we needed to escape the format string originally is that if the first output contains unrepresentable characters, it automatically forces output format 7. Escaping it removes the unrepresentable characters and allows format 0 to be selected.)
Of the six initial stack elements, the topmost is the main program (and is consumed by the `13` that's the first thing to run); the second is the `023` that selects the output format and requests input, and is consumed by that operation; the third is consumed as a side effect of the `3` operation (it's used to discard stack elements in addition to producing output); the fourth, `40`, is the body of the loop (and consumed by the `5` that executes the loop); and the fifth and sixth are swapped a number of times equal to the input (thus end up in their original positions if the input is even, or in each others' positions if the input is odd).
You could golf off a character by changing the leading `177` to `17` (and relying on an implicit empty sixth stack element), but that would change the parity of the outputs to a less idiomatic method than odd-is-true, and it doesn't save a whole byte (the source is still seven bytes long). As such, I decided to use the more natural form of output, as it doesn't score any worse.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 1 byte
```
Ḃ
```
[Try it online!](https://tio.run/nexus/jelly#@/9wR9N/I4Ogw@2Pmtb8BwA "Jelly – TIO Nexus")
Just another builtin.
For people who don't know Jelly: it has quite a bit of ability to infer missing bits of code, thus there isn't much syntactic difference between a snippet, a function, and a full program; the interpreter will automatically add code to input appropriate arguments and output the result. That's pretty handy when dealing with PPCG rules, which allow functions and programs but disallow snippets. In the TIO link, I'm treating this as a function and running it on each integer from 1 to 20 inclusive, but it works as a full program too.
# [Jelly](https://github.com/DennisMitchell/jelly), 2 bytes
```
&1
```
[Try it online!](https://tio.run/nexus/jelly#@69m@N/IIOhw@6OmNf8B "Jelly – TIO Nexus")
It's pretty short without the builtin, too. (This is bitwise-AND with 1.)
[Answer]
# Pure Bash, 8
* 3 bytes saved thanks to @Dennis
```
(($1%2))
```
Input given as a command-line parameter to this function `f`. Output returned as a shell return value - display with `echo $?`
[Answer]
## [Alice](https://github.com/m-ender/alice), 7 bytes
```
1\@
oAi
```
[Try it online!](https://tio.run/nexus/alice#@28Y48CV75j5/7@hkTEA "Alice – TIO Nexus")
Prints `0` for even inputs and `1` for odd inputs.
### Explanation
This is structurally similar to [my addition program](https://codegolf.stackexchange.com/a/116094/8478), but the flipped mirror subtly changes the control flow:
```
1    Push 1.
\    Reflect northeast. Switch to Ordinal.
     Bounce off the boundary, move southeast.
i    Read all input as a string.
     Bounce off the corner, move back northwest.
\    Reflect south. Switch to Cardinal.
A    Implicitly convert input string to integer. Compute bitwise AND with 1.
     Wrap around to the first line.
\    Reflect northwes. Switch to Ordinal.
     Bounce off the boundary, move southwest.
o    Implicitly convert result to string and print it.
     Bounce off the corner, move back northeast.
\    Reflect east. Switch to Cardinal.
@    Terminate the program.
```
]