Compiling and Running the Program

The program types.c we discussed above is a simple program, where statements of C are executed in sequential order and each one is executed once only. There is no loop to repeat any statement either there is any conditional statement to select a statement for execution.

Figure: Running of program: Basic data types
Image typesrun

The data declaration part is for restricting the size and type of data that can be stored in the variables. This binds the type with the variables, hence in the future statements in the program only that type of data can be assigned to that variable, else there will be error.

The errors in the program are checked during the compiling. The source program is types.c and the compiled program is a.out. We note that size of source program is only 328 bytes, while the size of compiled and linked program a.out is 16104 bytes. The latter is far bigger, because the for every statement in the source language (C here) there ar hundred of machine language statements. Imagine, if we are asked to write a program in machine language, it will be too tedious and time consuming process. So, let us thank to the people who wrote compilers, which have simplified the job for us, cheers to them !!

Figure: Listing the files
Image listing