These statements are evaluated by the processor of the computer rather than the compiler of the language. It means processor automatically interprets these statements and there after work of compiler will start normally. These statements are given above the main function and these will start with ‘#’ symbol. All though these can be used anywhere in the program.
There are many types of pre-processors programs
1. #include
2. #define
#include
These statements can be used to include any library file or header file in the program. These header files have in-built function which have unique names. Once any particular type header file is used then all library functions of that file can be included in the program. Library functions are in-built functions available in compiler and only its name is to be used where these are to be used.LIBRARY FUNCTIONS OF <math.h> file
sqrt()It gives the square root of a number i.e. sqrt(4)= 2;
pow()
It gives second number raise to power of the first number i.e. pow(x,y)= x^y;
abs()
It gives the absolute value of any number. It means it gives number without any positive or negative sign i.e. abs(-3)= 3;
floor()
It gives the lower integer value of the given number. It means it truncates the fractional part of the number and gives integer value i.e. floor(7.4)=7, floor(-8.51)=-9;
ciel()
It gives the large integer number of the given fractional value i.e. ciel(7.43)= 8, ciel(-11.13)= -11;
No comments:
Post a Comment