C Library Functions
C Library Functions
Library functions are built-in functions that are grouped together and placed in a common location called
library.
Each function here performs a specific operation. We can use this library functions to get the pre-defined
output.
All C standard library functions are declared by using many header files. These library functions are
created at the time of designing the compilers.
We include the header files in our C program by using #include<filename.h>. Whenever the program is
run and executed, the related files are included in the C program.
C Math Functions
There is also a list of math functions available, that allows you to perform mathematical
tasks on numbers.
To use them, you must include the math.h header file in your program:
#include <math.h>
1. Square Root
To find the square root of a number, use the sqrt() function:
2. Round a Number
The ceil() function rounds a number upwards to its nearest integer, and
the floor() method rounds a number downwards to its nearest integer, and returns the
result:
3 Power
The pow() function returns the value of x to the power of y (xy):
Function Description