Computer Science-1999

Q 1 (a) Why main function is so special. Give two reasons?
Ans. 1(a) Whenever a C++ program is executed only the main() is executed i.e., execution of the program starts and ends at main(). The main() is the driver function of the program. If it is not present in a program, no execution can take place.

Q 1 (b) Name the header file of C++ to which following functions belong:
(i) strcat() (ii) scanf() (iii) getchar() (iv) clrscr( )

Ans. 1 (b) (i) string.h (ii) stdio.h (iii) stdio.h (iv) conio.h

Q 1 (c) Find the syntax error(s), if any, in the following program:
int x[5],*y,z[5];


Ans. 1 (c) (i) Line No 5: Undefined symbol ‘i’. The variable ‘i’ is not declared in the program.

(ii)Line No 10: An attempt has been made to assign the value of a pointer to an integer variable.

  1. No comments yet.
  1. No trackbacks yet.