Unix C Programming Sample Program

Developing C Program in Unix requires good knowledge of Unix Command and Scripting Language. C programming in Unix is not simple compare to Windows.

Here is the step for creating and running Unix C Programming Sample Program.

Step-1 First you need to logged in into Unix/Linux system.

Step-2 Start the vi editor for a new filed called hello.c by typing

vi hello.c

Step-3 Press the i key, to start the insertion mode

Step-4 Enter the following C program statements

Step-5 Now press the Esc key to stop the insertion mode.

Step-6 Type :wq to save the file

Step-7 Now compile the file by typing the following

gcc hello.c -o hello //gcc <cfilename> -o <outputfilename>

Step-8 To execute the program, type:

./hello