Getting Started with C

(a) Define Compiling.

The process of converting source program into object program is known as compiling. The program saved with .c extension is source program. The source program cannot be executed directly by the computer. A compiler converts the source program into object program and saves it in a separate file with .obj extension. The source program cannot be compiled if it contains any syntax error.

(b) Distinguish between #include and #define directives.

# include
#Include directives are typically used to include the C header files for C functions that are held outside of the current source file. # include is used to include header files in the program.

# define
#define directive allows the definition of macros within your source code. These macro definitions allow constant values to be declared for use throughout your code.

(c) What is the use of “include” preprocessor?

The “include” preprocessor directive enables a program to access a library. Each library contains different header files. The include preprocessor directive is used to include header files in the program. The include directive tells the compiler where to find the meanings of standard identifiers such as “printf”. The meanings are described in standard header files.

(d) Explain the main function used in C program.

Every C program has a primary (main) function that must be named main. The main function serves as the starting point for program execution. It usually controls program execution by directing the calls to other functions in the program. A program usually stops executing at the end of main, although it can terminate at other points in the program for a variety of reasons. “main” function is “called” by the operating system when the user runs the program.

(e) What do you meant by delimiters?

A delimiter is a unique character or series of characters that indicates the beginning or end of a specific statement, string or function body set.
Delimiters are used in programming languages to specify code set characters or data strings, serve as data and code boundaries and facilitate the interpretation of code and the segmentation of various implemented data sets and function.

Delimiter examples include:
Round brackets or parentheses: ( )
Curly brackets: { }
Escape sequence or comments: /*
Double quotes for defining string literals: ” ”

(f) What are preprocessor directives?

The preprocessor directive is an instruction given to the compiler before the execution of actual program. It is also known as compiler directive. They are processed by a program known as preprocessor. It is a part of C++ compiler. Preprocessor directives start with hash symbol # and the keyword include or define. These directives are written at the start of program.

(g) List necessary steps required for writing a C language program?

Steps required for writing a C language program:

  1. Creating and Editing a C program
  2. Saving a C program
  3. Compiling a C program
  4. Linking a C program
  5. Loading a C program
  6. Executing a C program