using the mingw-w64 cross compiler
xxxxxxxxxx
# installing the cross compiler
sudo apt-get install mingw-w64
# for 32 bit
i686-w64-mingw32-gcc -o test.exe test.c
# for 64 bit
x86_64-w64-mingw32-gcc -o test.exe test.c
https://stackoverflow.com/questions/44670209/how-to-compile-c-code-in-linux-to-run-on-windows