Download the MinGW ( GCC ported to Windows ) on this site , install it and add the system variables.
Click Tools > Build System > New Build System , in the window that opens put the code below:
{
"cmd" : ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe"],
"selector" : "source.c",
"shell" : true,
"working_dir" : "$file_path"
}
Save as C.sublime-build
.
Switch BuildSytem to C: Tools > BuildSystem > C.
Type a code in C and compile by pressing ctrl + b or on the Tools > Build .
Result:
Source: How do I compile and run a C program in Sublime Text 2?