Let's consider a simple algorithm that tests the [Collatz conjecture](collatz_conjecture.md) (which says that applying a simple operation from any starting number over and over will always lead to number 1). The algorithm in [C](c.md) would look as follows:
```
// Collatz conjecture
#include <stdio.h>
int next(int n)
{
return n % 2 ? // is odd?
3 * n + 1 :
n / 2;
}
int main(void)
{
int n = getchar() - '0'; // read input ASCII digit
while (1)
{
printf("%d\n",n);
if (n == 1)
break;
n = next(n);
}
return 0;
}
```
The program reads a number (one digit for simplicity) and then prints the sequence until reaching the final number 1. Now let's rewrite the same algorithm in [comun](comun.md), a language which will allow us to produce bytecode: