II-8 Programming Concepts
13. Explain the functions of a linker.
Ans: The linker puts together all other program files and functions that are required by the program.
For example, if the programmer is using pow() function, then the object code of this function should
be brought from math.h library of the system and linked to the main() program. After linking, the
program is stored on the disc.
14. What is the role of curly braces ({}) in a C program?
Ans: The curly braces are used to define the block of statements. The statements inside the curly
braces are having different scope than that of the statements outside the curly braces. The curly braces
can be used to define the blocks for decision and loop statements.
15. What are the user-defined functions?
Ans: The user-defined functions are created by the user; the contents of the user-defined functions
are completely known to the user and can be modified by the user.
16. Write details on header files stdio.h and conio.h.
stdio.h: Standard input and output file. All formatted and unformatted functions include file oper-
ation functions defined in this file. The most useful formatted printf() and scanf() are defined
in this file. Most useful functions from this header files are printf(), scanf(), getchar(),
gets(), putc() and putchar().
conio.h: Console input and output file. This file contains input and output functions along with a few
graphic-supporting functions. The getch(), getche() and clrscr() functions are defined in this file.
17. Which are the standard directories? Where are .h files kept?
Ans: The turbo-C has three standard directories; they are include, sys and lib. The sys is the sub-directory
of include. The include directory contains all the header files and lib contains all the library files. The header
files are stored in ‘include’ directory. The path could be c:/turboc2/include - if C is installed on ‘drive C’.
18. Write any three advantages of the C language.
Ans: The advantages of the C language include the following:
1. It contains a powerful data definition. The data types supported are characters, alphanumeric,
integers, long integer, floats and double. It also supports string manipulation in the form of
character array.
2. It supports a powerful set of operators.
3. It also supports powerful graphics programming and directly operates with hardware. Execution
of program is faster.
4. An assembly code is also inserted into C programs.
Multiple-choice Questions
1. Hard disc is a .
(a) Input device (b) Output device
(c) Both input as well as output (d) None of the above
2. Mouse is a .
(a) Input device (b) Output device
(c) Both input as well as output (d) None of the above
M01_ITL-ESL4791_02_SE_C01.indd 8 12/22/2012 4:59:19 PM