Common Library Functions
C languages come bundled with some Standard Libraries that contain some useful functions to make it easier to perform some common operations. These are as follows:
The <math.h> header file contains functions to perform the arithmetic operations. The following table contains some common maths functions in C:
S.No. |
Function Name |
Function Description |
---|---|---|
1. |
ceil(x) |
Returns the largest integer smaller than or equal to x. |
2. |
floor(x) |
Returns the smallest integer larger than or equal to x. |
3. |
Returns the absolute value of x. | |
4. |
sqrt(x) |
Returns the square root of x. |
5. |
cbrt(x) |
Returns the cube root of x. |
6. |
pow(x , y) |
Returns the value of x raised to the power y. |
7. |
exp(x) |
Returns the value of e(Euler’s Number) raised to the power x. |
8. |
fmod(x , y) |
Returns the remainder of x divided by y. |
9. |
log(x) |
Returns the natural logarithm of x. |
10. |
log10(x) |
Returns the common logarithm of x. |
11. |
cos(x) |
Returns the cosine of radian angle x. |
12. |
sin(x) |
Returns the sine of radian angle x. |
13. |
tan(x) |
Returns the tangent of radian angle x. |
C Cheat Sheet
This C Cheat Sheet provides an overview of both basic and advanced concepts of the C language. Whether you’re a beginner or an experienced programmer, this cheat sheet will help you revise and quickly go through the core principles of the C language.
In this Cheat Sheet, we will delve into the basics of the C language, exploring its fundamental concepts that lay the groundwork for programming. We will cover topics such as variables, data types, and operators, providing you with a solid understanding of the building blocks of C programming.
Contact Us