How to see output of C program in Linux or UNIX

How to see output of C program in Linux or UNIX

To see the output of a C program in Linux or UNIX, you will need to compile and run the program. Here's a general outline of the steps you can follow:

  1. Open a terminal and navigate to the directory where your C program is located.

  2. Compile the program using the gcc compiler. For example:

r‮ refe‬to:lautturi.com
gcc -o program program.c

This will create an executable file called program from the source code in program.c.

  1. Run the program by typing its name and pressing Enter:
./program

This will execute the program and display the output in the terminal.

Alternatively, you can use an integrated development environment (IDE) such as Eclipse, NetBeans, or Visual Studio to compile and run your C programs. These IDEs typically have a built-in terminal emulator that you can use to see the output of your programs.

Created Time:2017-10-29 22:08:37  Author:lautturi