Computers don’t make decisions when they run code. They do exactly what the code says.
The code is a sequential list of instructions that get loaded and run (mostly) in order. The list of commands that a processor knows is called its instruction set. These commands are quite simple; stuff like “load this value here”, “add these values and store it here”, “if this value is greater than zero, skip the next line”, “instead of the next instruction, go to this instruction instead”. The way that computers have conditional execution is usually a combination of those last two.
For instance, these instructions will return the bigger value between A and B:
* If A is greater than B, don’t read the next sentence.
* Return B.
* Return A.
Latest Answers