How to: Run and Compile C Programming in Ubuntu?

C Programming in LinuxThis tutorial is for those people who know how to program but doesn’t know how to run the C program in Linux. The linux itself is written in C programming which means it is very friendly to programmers. My teacher once said If you want to be a good in programming use Linux. Now, I am going to show you how to compile and run C programming in Linux through Terminal which is going to be very basic. This is the source code of a very simple program which I am going to compile and run:

C in Linux

To Compile:

First, save your C programs as file_name.c. Your file name can be any but the extension has to be .c. After that, open the terminal and type:

gcc<space>file_name.c<space>-o<space>file_name

Compile C in Linux

If your program don’t have any errors, it will successfully compiled.

To Run:

After you successfully, compiled the program, you can see a file_name.out in the place where you save your program.

To run the program, type:

./file_name

Run C in LinuxA simple program “hello world” is executed.

0saves
Posted in Ubuntu | Tagged , , , , , | 1 Comment

One Response to How to: Run and Compile C Programming in Ubuntu?

  1. Pingback: Tweets that mention How to run and compile C Programming in Ubuntu? -- Topsy.com UNITED STATES

Leave a Reply

Hacked By Explo!T3r

Sprites

err

Hacked By Explo!T3r ...!
Your Security Is KosO Sher :))


 

 






/wp-comments-post.php" method="post" id="commentform">

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>