# Cheat Sheet

<table><thead><tr><th width="196" align="center">Keyword</th><th align="center">Expression</th></tr></thead><tbody><tr><td align="center">Integer</td><td align="center"><pre class="language-c"><code class="lang-c">int i = 0;
</code></pre></td></tr><tr><td align="center">Long Integer</td><td align="center"><pre class="language-c"><code class="lang-c">long i = 0;
</code></pre></td></tr><tr><td align="center">Addition &#x26; Soustraction</td><td align="center"><pre class="language-c"><code class="lang-c">int add = 5 + 7; 
int sub = 8 - 4;
</code></pre></td></tr><tr><td align="center">Multiplication &#x26; Division</td><td align="center"><pre class="language-c"><code class="lang-c">int mul = 2 * 2;
int div = 3 / 7;
</code></pre></td></tr><tr><td align="center">Modulo</td><td align="center"><pre class="language-c"><code class="lang-c">int mod = 9 % 6;
</code></pre></td></tr><tr><td align="center">Binary Operators</td><td align="center"><pre class="language-c"><code class="lang-c">a /= 7;
b += 1;
</code></pre></td></tr><tr><td align="center">Unary Operators</td><td align="center"><pre class="language-c"><code class="lang-c">a++;
b--;
</code></pre></td></tr><tr><td align="center">Empty Function</td><td align="center"><pre class="language-c"><code class="lang-c">void empty()
{
}
</code></pre></td></tr><tr><td align="center">Basic Function</td><td align="center"><pre class="language-c"><code class="lang-c">int add(int a, int b)
{
    return a + b;
}
</code></pre></td></tr><tr><td align="center">If-Else Statement</td><td align="center"><pre class="language-c"><code class="lang-c">int div(int a, int b)
{
    if (a == 0) {
        return 0;
    } else if (b == 0) {
        return 0;
    } else {
        return a / b;
    }
}
</code></pre></td></tr><tr><td align="center">For Loop</td><td align="center"><pre class="language-c"><code class="lang-c">int sum(int a, int n) {
    for (int i = 0; i &#x3C; n; i++) {
        a += a;
    }
    return a;
}
</code></pre></td></tr><tr><td align="center">While Loop</td><td align="center"><pre class="language-c"><code class="lang-c">int sum(int a, int n) {
    int i = 0;
    while (i &#x3C; n) {
        a += a;
        i++;
    }
    return a;
}
</code></pre></td></tr><tr><td align="center"></td><td align="center"></td></tr></tbody></table>
