They offer different flash templates with latest features.

Forgot password
Written by:
Score: 13
votes: 17
Format: Article

 How to run C program in linux?

Install C and C++ Compilers in Mint

sudo aptitude install build-essential
This will install all the required packages for C and C++ compilers

Compiling Your first C Programs

Now you need to open first.c file
sudo gedit first.c
add the following lines save and exit the file

int main()
printf(“Hello world\n”);
return 0;

Firstly compile the code using the following command

cc -c first.c

that would produce an object file you may need to add to the library.

then create an executable using the following command

cc -o first first.c

Now run this executable using the following command

Output should show as follows
Hello, world

Tags: c in linux
Created: 7 years ago.
Last edited: 7 years ago.
Reviewed: 7 years ago.

7 years ago

The tags are removed when you press edit, but you can fix the tutorial and save it and it will work. If you then choose to edit it once more you must make sure to also re-add whatever the editor takes away... :(
I don't know of any other way.
7 years ago

7 years ago

Ok. The code probably went missing after editing the text.
A bug in CKEditor:
7 years ago

1. #include
should be:
#include <stdio.h> // parenthesis won't render (html/xml???)
This explains the "undeclaired" part of the errors...

2. printf(“Hello world\n”)
The quotation marks is not plain ascii so that would
explain the "stray `\342'... etc.
We need a "Code component" thing for tutorials!

3. I'm with @frankh:
gcc -o name name.c
7 years ago

@parashargunjan:have you used conio.h header file?  
7 years ago

first.c: In function ‘main’:
first.c:4: error: stray ‘\342’ in program
first.c:4: error: stray ‘\200’ in program
first.c:4: error: stray ‘\234’ in program
i m getting the below error plz help me out

first.c:4: error: ‘Hello’ undeclared (first use in this function)
first.c:4: error: (Each undeclared identifier is reported only once
first.c:4: error: for each function it appears in.)
first.c:4: error: expected ‘)’ before ‘world’
first.c:4: error: stray ‘\’ in program
first.c:4: error: stray ‘\342’ in program
first.c:4: error: stray ‘\200’ in program
first.c:4: error: stray ‘\235’ in program
7 years ago

very nice..
7 years ago


Nice job!
7 years ago

@trollboy:thankx,spread it if u like it  
7 years ago

Nice simple introduction  
7 years ago


Needless to say, I clicked on Promote Button when I added my first comments.

( And then I added you as my friend. I would be glad if you would also add me as your friend.)

7 years ago

@kazztan0325:thankx,i will keep this way of explaining.If u like it then please promote it.  
7 years ago


For the simplest compilation and use of C i Linux, it's not necessary to create an object file first. You can do gcc -o name name.c, and you'll immediately have an executable file.
7 years ago

I think this tutorial is very useful and easy to follow for beginners who are interested in C and C++ to start learning them.

Other tutorials from MadhaniHarsh