How can we write and compile a C program in Linux?

Asked By 280 points N/A Posted on -
qa-featured

How can we write and compile a C program in Linux?

SHARE
Best Answer by farhan
Best Answer
Best Answer
Answered By 0 points N/A #88907

How can we write and compile a C program in Linux?

qa-featured

Write the code in a text file and save it with .c extension. Then open the terminal and go to that location where you have saved that file(with the help of cd command). After that you can write gcc fileName.c and then press enter. If it runs successfully, it will not show any error otherwise correct the highlighted error. Then you have to type ./a.out, this will run the program. I will suggest you to first compile and run a small program. (just print "Assalam O Alaikum" through printf)

Answered By 0 points N/A #88909

How can we write and compile a C program in Linux?

qa-featured

Most Linux and Unix programs are written in C. When you download source for a project, it will often be C or C++ source code. You don't necessarily need to know a darn thing about C or anything else to compile the source if you aren't changing it. It may be helpful for you to understand a bit if you are having problems with the compile, but even that isn't really necessary.

Answered By 0 points N/A #88911

How can we write and compile a C program in Linux?

qa-featured

This article is for those guys who used to write a lot of programs under Windows, and now have entered the Linux territory. You have probably heard a lot about Linux and how you can do some real good programming under Linux. But right now you cant even get the simplest of Hello World programs to compile.

Answered By 0 points N/A #88912

How can we write and compile a C program in Linux?

qa-featured

Web site is just a group of all files in a folder and sub folders. There is no project file. All files under the specific folder – including your word documents, text files, images etc are part of the web site.

Related Questions