A C program can be executed on platforms such as DOS, UNIX etc. DOS stores C program with a file extension .c
. Program text can be entered using any text editor such as EDIT or any other . To edit a file called testprog.c
using edit editor.
C:> edit testprog.c :
If you are using Turbo C, then turbo C provides its own editor which can be used for writing the problem. Just give the full pathname of the executable file of Turbo C and you will get the editor in front of you.
For Example :
Here, tc.exe is stored in bin sub directory of turbo c directory. After you get the menu just type the program and store it in a file using the menu provided. The file automatically gets the extension of .c.
Unix also stores C program in a file with extension is .c. This identifies it as a C program. The easiest way to enter your text is using a text editor like vi, emacs or xedit. To edit a file called testprog.c using vi type.
The editor is also used to make subsequent changes to the program.
After write c program you need to have compile the program.