Class 6 Exam  >  Class 6 Notes  >  C Programming for Beginners  >  C Math Functions

C Math Functions | C Programming for Beginners - Class 6 PDF Download

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));

Other Math Functions

A list of other popular math functions (from the <math.h> library) can be found in the table below:
C Math Functions | C Programming for Beginners - Class 6

The document C Math Functions | C Programming for Beginners - Class 6 is a part of the Class 6 Course C Programming for Beginners.
All you need of Class 6 at this link: Class 6
10 videos|13 docs|15 tests

Top Courses for Class 6

10 videos|13 docs|15 tests
Download as PDF
Explore Courses for Class 6 exam

Top Courses for Class 6

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

mock tests for examination

,

Important questions

,

C Math Functions | C Programming for Beginners - Class 6

,

pdf

,

Previous Year Questions with Solutions

,

Summary

,

Objective type Questions

,

ppt

,

video lectures

,

Semester Notes

,

Free

,

past year papers

,

MCQs

,

shortcuts and tricks

,

C Math Functions | C Programming for Beginners - Class 6

,

Exam

,

practice quizzes

,

C Math Functions | C Programming for Beginners - Class 6

,

Extra Questions

,

Viva Questions

,

Sample Paper

,

study material

;