Math Function in C

The math.h header defines various mathematical functions and one macro. All the functions available in this library take double as an argument and return double as the result. Let us discuss some important functions one by one.

Source Code

//Math Function
int main()
    printf("\nSQRT  : %0.2f",sqrt(4));
    printf("\nPOW   : %0.2f",pow(2,3));
    printf("\nabs   : %d",abs(-25));
    printf("\nCEIL  : %f",ceil(3.8));
    printf("\nCEIL  : %f",ceil(3.2));
    printf("\nFLOOR : %f",floor(3.8));
    printf("\nFLOOR : %f",floor(3.2));
    printf("\nROUND : %f",round(3.8));
    printf("\nROUND : %f",round(3.2));
    return 0;
To download raw file Click Here

List of Programs

Sample Programs

Switch Case in C

Conditional Operators in C

Goto Statement in C

While Loop Example Programs

Looping Statements in C

For Loop Example Programs

Array Examples in C

One Dimensional Array

Two Dimensional Array in C

String Example Programs in C

Functions Example Programs in C

Learn All in Tamil © Designed & Developed By Tutor Joes