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

Windows

1. Download program from: http://www.bloodshed.net/dev/devcpp.html

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 the author

Anatoly Spektor

IT Consultant with 6 years experience in Software Development and IT Leadership. Participated in such projects as Eclipse IDE, Big Blue Button, Toronto 2015 Panam Games.

View all posts

2 Comments

  • 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

Leave a Reply

Your email address will not be published. Required fields are marked *