How to run and compile C language programs ?

This post dedicated for people, who never ran  and never compiled C programs. In this tutorial I will explain how to do it both in *nix operating systems and Windows. However, I recommend you to you Unix in your programming.  I assume that your  already have a code.

Unix & Linux

1. Open “Terminal”. Copy your code. (CTRL +C)

2. Open text editor and save your file with extension “.c”

3. Exit text editor

4.  Compile your file (make it executable) using command: cc <filename>

5. Type in Terminal: ./a.out

That’s all


1. Download program from:

2.  Download, Install and run software

3. Use CTRL +N and copy your code

4. Save file (File –> Save)

7. Click on Execute —> Compile

8. When compiling is done once again go to Execute and click Run

That’s it!

About Anatoly Spektor

My name is Anatoly Spektor (originally Anatolijs Spektors) I am Software and Web Developer. I have worked in Seneca Center for Development of Open Technology on Big Blue Button Add-on - Polling Module, Red Hat and some other places :) I am an author of the book 'Eclipse Debugging How To', Muay Thai fighter and amateur photographer ;)
This entry was posted in Bash (Unix Shell), C, Programming Languages and tagged , , , , , . Bookmark the permalink.

2 Responses to How to run and compile C language programs ?

  1. mashtan_abdl says:

    Thank you for this tutorial. I was wondering maybe you could help solve task i received at university:

    Write a program that reads in an integer and prints out the given integer in binary, octal and hexadecimal formats.

    your program should do the following tasks:

    * it should accept an integer number from the keyboard
    * change this number to binary, octal and hexadecimal formats
    * it should finally print these three formats to the screen

  2. k3jungs says:

    not working for me .

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s