🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to C Notes
Topic #65

C Math Functions


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>

Square Root

To find the square root of a number, use the sqrt() function:

Example

printf("%f", sqrt(16));

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:

Example

  printf("%f", ceil(1.4));
printf("%f",
  floor(1.4));

Power

The pow() function returns the value of x to the power of y (xy):

Example

printf("%f", pow(4, 3));

Complete Math Reference

For a complete reference of math functions, go to our C <math.h> Library Reference.

Want to go beyond the notes?

Join CodingNow 2.0's C course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

C Math Functions – FAQs

Quick answers about learning C Math Functions in C.

This free note from CodingNow 2.0 explains C Math Functions in C — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every C topic on CodingNow 2.0, including C Math Functions, is 100% free with no signup required.
With focused practice, most students grasp C Math Functions in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now