C Languages Interview Questions

5. What is a function?
  A Function is a set of instructions used to perform a specified task which repeatedly occurs in the main program.
 
Your Name Your Email-ID
Your Answer
6. What is the difference between declaration and definition of a function?
 
  • Like variables, declaration of a function only identifies the return type of the function and the type of format arguments. The declaration of a function is usually referred as a function prototype.
  • On the other hand, definition of a function contains the statements to accomplish the intended task. Like variables functions also have an address associated with its name.
 
Your Name Your Email-ID
Your Answer
7. What is gets() function?
 
  • The gets() function allows a full line data entry from the user.
  • When the user processes the enter key to end the input, the entire line of characters is stored to a string variable.
 
Your Name Your Email-ID
Your Answer
8. What are static functions?
  In C, functions are global by default.
  • The static keyword before a function name makes it static.
  • Unlike global functions in C, access to static functions is restricted to the file where they are declared.
  • Therefore, when we want to restrict access to functions, we make them static.
  • Another reason for making functions static can be reuse of the same function name in other files.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 2 of 15