C programming language provides a set of built-in math functions that can be used to perform various mathematical operations, such as:
Methods:
These functions are defined in the #include<math.h> library and are widely used in C programming to perform various mathematical operations. Keep in mind that, some of the math functions may not be supported on all platforms.
//Math Function #include<stdio.h> #include<math.h> 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
SQRT : 2.00 POW : 8.00 abs : 25 CEIL : 4.000000 CEIL : 4.000000 FLOOR : 3.000000 FLOOR : 3.000000 ROUND : 4.000000 ROUND : 3.000000
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions