1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
#include <stddef.h>
#include <stdio.h>

#define N 6

size_t factorial(size_t n)
{
    size_t res = 1;

    size_t i=2;
    goto while_check;
    while_loop:
        res *= i;
        ++i;
    while_check:
        if (i<=n) {
            goto while_loop;
        }

    return res;
}

int main()
{
    printf("result = %zu\n", factorial(N));

    return 0;
}