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.
Methods:
//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