#!/usr/bin/tcc -run
// Executable should self-compile and run !

#define uint unsigned int
#define ulong unsigned long int
#define ullong unsigned long long int

#include <stdio.h>

ulong factorial(ulong N) {
    ulong fact = 1, i;

    // Loop from 1 to N to get the factorial
    for (i = 1; i <= N; i++) {
        fact *= i;
    }

    return fact;
}

ulong powerof2(uint N) {
  ulong power=1;
  for(int i=0;i<N;i++) {
    power*=2;
  }

  return power;
}

int main() {
    for(uint N=1;N<100;N++) {
      ulong fact = factorial(N);
      printf("Factorial of %lu is %lu\n", N, fact);
      //ulong power=powerof2(N);
      //printf("2 power %u is %lu\n", N, power);
    }
    return 0;
}
