answersLogoWhite

0

1. Create the source into a file with any text editor, for example: myprog.c
2. Compile it: gcc -Wall -W -pedantic -g -o myprog myprog.c
3. Run it: ./myprog

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Where the c-program can be written in Linux and how to save it and compile?

Simply any text edittor can be used to write C program. To compile the .c file saved, Linux comes with gcc compiler. In the command line: $ gcc -o outputfile inputfile.c will compile the inputfile.c and create executable outputfile. Other than that there are number of IDEs (i.e. Integrated Development Environment) are available such as Kdevelop, Eclipse etc.


How do you use c program?

Compile, link and execute them.


How a c program execute?

Compile and link it into an executable.


How is C program portable?

Your program is portable if you can compile and execute it on different platforms.


How do you compile a c program in windows OS?

First, install a C-compiler.


Why cannot you include conioh in your c program when you program in Linux system?

You could, if you had conio.h in linux, but you don't have, that's why.


Is there a free service that compiles C programs for Linux?

Linux generally comes installed with the free gcc compiler. MacOSX does too. But when you compile a program with gcc, it runs on the platform under which it was compiled. Therefore, programmers on OSX that need to deliver a Linux binary need to use gcc's cross-compiler mode to produce Linux binaries.


How do you compile an average score in c?

In linux: cc -W -Wall -pedantic -g -o average average.c


How do you write a C program in Linux?

1. Create your source-file with any text-editor (mcedit myprogram.c, for example).2. Compile it: gcc -g -Wall -W -pedantic -o myprogram myprogram.c3. Fix the errors and warnings, if any4. Run your program: ./myprogram(Note: you should not use linux-9.0 yet, as only linux-2.6.x released).


How do you save a c program in Linux?

It depends on the editor.


What is the difference between make and compile in c?

make is a utility program, compile means translation from source to object module.


How is a C program rum?

C-source program doesn't rum, you have to compile and link it. The executable rums like any other binary program.