Machine-translated by Google. Questions are authored in English.
Top

Discussion

The statement
# include < math.h>
is written at the top of a program to indicate

  • A.end of the program
  • B.beginning of the program
  • C.that certain information about mathematical library functions are to be included at the begnning of the program
  • D.none of these

Answer: C

Correct answer: that certain information about mathematical library functions are to be included at the begnning of the program

#include <math.h> directs the preprocessor to insert the contents of the header at that point - the declarations of the mathematical library functions, along with any macros and types they need.

What it brings in is declarations, not the functions themselves: the code lives in the library and is joined at link time. Without the header the compiler would have to guess at the return types, and a call to sqrt would be assumed to return int, giving silently wrong results.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.