C Language Interview Questions and Answers for Freshers - 3

Question: 11

Can we make our own header files?

Yes. You can make your own header files and put the declarations of functions and related constants and macros developed by you.

 

Question: 12

What is the difference between rand(), random(), and randomize()?

random() - returns random number between 0 and one less that its argument.

rand () – returns successive pseudo random numbers in the range 0 to RAND_MAX.

srand() – initializes the random number generator with a given seed value.

randomize() – initializes the random number generator with a random value.

Question: 13

What is a subprogram/module?

It is a program carrying out a particular function and which be called by another program known as the calling program.

A subprogram needs to be placed only once in memory and can be called by the main program or other subprogram as many times as the programmer wants. Also known by various names as function, subroutine or procedure.

Question: 14

What are the differences between exit() and return statement?

First difference is that exit() is a function while return is a statement.

Second difference is that exit() function terminates the program while return statement terminate the function.

Third difference is that exit() function always return some value where it is optional for return statement.

Question: 15

Do function prototypes get stored in executable file?

No. The compiler uses these functions prototypes at the time of compilation.

Therefore, once the program is compiled, they are not required.

Hence they are not stored in executable file.

Related Questions