How to Compile and Run C/C++ Programs on Windows in 60 Seconds

By | January 13, 2017
Compile and run c and c++ programs on windows in 60 seconds

Compile and run c and c++ programs on windows in 60 seconds

I have struggled for running c & c++ programs using different tools and its difficult configuration.After my research,i found one tool called “MinGW” Software,it has c/c++ compiler suite.It’s very easy to use.

All we need to do is Just install the software in 30 Seconds and run your program in next 30 seconds.Before,we go and install this software,lets highlight few things about “MinGW” Software.

1) MinGW is a C/C++ compiler suite which allows you to create a programs on windows.

2) Interesting Part is,it also contains small portion of environment like POSIX (compiled with MinGW called MSYS).

Let’s jump on to ,install instructions

Step 1: Download MinGW from MinGW Software Location.It is size of 88 KB.

Step 2: Click on the Setup.exe,it takes some 30 seconds and go with defaults.

Some Screenshots captured while i am doing the setup on my windows machine.

How to Compile and Run C/C++ Programs on Windows in 60 Seconds

How to Compile and Run C/C++ Programs on Windows in 60 Seconds – Image 1

By Default,it will be installed to the Location “C:\MinGW\”.What i observed is with default installation you only “c Compiler”.But if you want c++ compiler,you have to follow the below instruction.Check on c++ compiler also will be installed.We have support on fortran,ada,objective c.Go through below screenshot.you get more details.

How to Compile and Run C/C++ Programs on Windows in 60 Seconds

How to Compile and Run C/C++ Programs on Windows in 60 Seconds – Image 2

Once it is completed.Now come to the running our first Example steps.

  1. Go to the location of “C:\MinGW\bin”.Here,you will find the all the binaries and compilers.
  2. Create a new file with the below content and save it as “test.c” in the same location,as above.
#include <stdio.h>
 int main()
 {
 printf("Welcome to "www.SimplyLearnTopics.com"\n");
 }

3. run the below command to compile and create a Execute File.

C:\MinGW\bin>gcc C:\MinGW\bin\first.c -o test.exe

4. If you are successful in creation of the executable .Simply drag and drop that executable on the command prompt and say enter.

5. You will be seeing the output as below.

 
   C:\MinGW\bin>C:\MinGW\bin\test.exe
   www.SimplyLearnTopics.com

If you like Simplylearntopics.com and would like to contribute, you can Send article to [email protected]”.It will start appearing on the SimplyLearnTopics.com main page and help other Learners.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

If you like the Article ,Wants to subscribe to our News Letter,Please provide the Email in the below form.we will send the most Interesting Articles to you.

Enter your email address to send you the most Interesting Articles

Delivered by FeedBurner

The following two tabs change content below.

SRINIVAS DARIPELLI

Myself SRINIVAS DARIPELLI. I have 15+ Years of Experience in Programming worked on multiple technologies.Apart from it,I am a blogger, writer, editor, artist and dad 🙂 .I believe in reality.I love to share the Helpful things around the Technology. Feel free to connect with me

2 thoughts on “How to Compile and Run C/C++ Programs on Windows in 60 Seconds

Leave a Reply