To compile to .exe open the command prompt and type this:

gcc fileName.c - compiling and linking, produces a.exe

or

gcc -c fileName.c - only compiling, produces fileName.o object file

gcc -o test filename.o - linking and produces test.exe

If there are more than 1 source file you can do the just compiling part for all files and generate object files.Then do the linking by adding their names in the command.Of curse this is applicable if there are less files but for a bigger project you have to write a makefile.

Answer from Korsarq on Stack Overflow
🌐
Ideone
ideone.com › fork › cuHBal
Online Compiler and IDE >> C/C++, Java, PHP, Python, Perl and 70+ other compilers and interpreters - Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
🌐
Quora
quora.com › What-are-some-good-C-compilers-that-will-give-me-an-exe-file
What are some good C compilers that will give me an .exe file? - Quora
Answer (1 of 5): Question: What are some good C compilers that will give me an .exe file? None - totally honest here - and not because I’m against C - I program C++ in my personal time for fun. In C and C++, a compiler will only compile the C/C++ code to object code. One needs a linker to produ...
🌐
JDoodle
jdoodle.com › c-online-compiler
Online Compiler and Editor/IDE for Java, C, C++, PHP, Python, Ruby, Perl - Code and Run Online
JDoodle is an Online Compiler, Editor, IDE for Java, C, C++, PHP, Perl, Python, Ruby and many more. You can run your programs on the fly online, and you can save and share them with others. Quick and Easy way to compile and run programs online.
🌐
Quora
quora.com › How-do-I-convert-a-C-program-to-an-executable-e-g-exe-file
How to convert a C program to an executable (e.g. .exe) file - Quora
Answer (1 of 16): For windows if you are using any IDE then after compiling you get .exe file in the same directory where your .c file is stored. However for linux , after compiling you don't get .exe file. You need to compile it using the below command gcc pro.o -o pro.exe This will give you ...
🌐
Sololearn
sololearn.com › en › Discuss › 2706719 › how-can-i-convert-c-to-exe
How can i convert .c to .exe | Sololearn: Learn to code for FREE!
Write your code and then compile it. It will generate a .exe file for your corresponding .c file. ... I'm doing java and python but evrebody is saying that nobody uses python is thst true sould I switch language ... I am new in programing world anyone can help me to master programming I choose C# language any one can told me how use teach me
Find elsewhere
🌐
Compiler Explorer
godbolt.org
Compiler Explorer
Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.
🌐
Sololearn
sololearn.com › en › Discuss › 1232677 › how-to-convert-a-cc-code-to-exe-
How to convert a c/c++ code to exe ? | Sololearn: Learn to code for FREE!
Build and compile.Find the exe file.Test it.If you want the program to run on another computer as well, that computer must have VC++ Runtime libraries installed. SOURCE: https://www.wikihow.com/Compile-CPP-File-to-EXE ... Beause your question is very basic i suggest a search on Google... You will find faster your answer, more i add some useful links: https://code.sololearn.com/WaVusr8J1KvK/?ref=app
🌐
DaniWeb
daniweb.com › programming › software-development › threads › 327583 › create-a-program-exe-file-in-c
file system - create a program exe file in C. [SOLVED] | DaniWeb
To produce a compact, self-contained release build, build in Release mode (no debug info) and statically link the toolchain runtimes. From a terminal using the same compiler Dev-C++ uses, a typical command for a console C program is: ... -O2 optimizes, -s strips symbols, and -static links against static libs where available so you can copy just the .exe to another machine (system DLLs like kernel32 remain, which is fine).
🌐
Go4Expert
go4expert.com › forums › converting-c-file-exe-t18525
Converting A C File Into .exe | Go4Expert
Hi could any one tell how to convert a c file into an executable file ? Also I have designed a simple screen saver in C ..How can I convert it into a...
🌐
OnlineGDB
onlinegdb.com › online_c_compiler
Online C Compiler - online editor
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it.
🌐
Quora
quora.com › Are-there-any-online-C-compilers-for-Windows
Are there any online C compilers for Windows? - Quora
Answer (1 of 2): Of course. There are online compilers for anything. Here’s a list of them for C. 1. Compiler - Code, Compile, Run, Debug online C, C++ - I personally love this one. It’s simple, and it has a better debugger for C and C++ than you’d find on a terminal.
🌐
Wikihow
wikihow.com › computers and electronics › software › file manipulation › how to compile a cpp file to an exe on windows: 2 tools
How to Compile a CPP File to an EXE on Windows: 2 Tools
August 22, 2007 - Reopen your CPP file in VS Code. Click the Play button at the top-right and select Run C/C++ File. From the list of compilers, select C/C++: g++.exe build and debug active file.