standard Math library Functions includestdioh input output standard functions

Standard math library functions includestdioh input

This preview shows page 1 - 2 out of 2 pages.

standard Math library Functions : #include<stdio.h> // input output standard functions are defined in this #include<math.h > // all standard math functions are defined #include<stdlib.h> // here used only for rand() function void main() { int ab,random; // variable declarations double cel,cosine,floatabs,flo,logbase_e,logbase_10,power,expo,sq_root,ncel,nflo; ab=abs(-8); // gives absolute value of integer argument cel=ceil(45.0001); // Returns the smallest integer value greater than or equal to x ncel=ceil(-45.0001); // Returns the smallest integer value greater than or equal to x cosine=cos(30*3.14159/180); //for this first angle must be converted in radian expo=exp(1.0); // gives e to the power argument value floatabs=fabs(-8.432); // gives absolute value of float argument Page 1 of 2
Image of page 1
flo=floor(45.99356); //Returns the largest integer value less than or equal to x. nflo=floor(-45.99356); //Returns the largest integer value less than or equal to x. logbase_e=log(2.71828); // calculates natural log of argument (i.e base e) logbase_10=log10(100); // calculates log of argument at base 10 power=pow(0.16,0.5); // calculates power i.e pow(base, power) format random=rand(); // generates random number sq_root=sqrt(2.25); // calculates squirroot of argument printf("The absolute value of -8 is : %d\n", ab); printf("The ceil value of 45.0001 is : %lf\n", cel); printf("The ceil value of -45.0001 is : %lf\n", ncel); printf("The cos value of degree 30 is : %lf\n", cosine); printf("The exponential value of 1 is : %lf\n", expo); printf("The absolute value of double type argument -8.432 is : %lf\n", floatabs); printf("The floor value of 45.99356 is : %lf\n", flo); printf("The floor value of -45.99356 is : %lf\n", nflo); printf("The natural log value of 2.71829 is : %lf\n", logbase_e); printf("The log base 10 for value 100 is : %lf\n", logbase_10); printf("The value of pow(0.16,0.5) is : %lf\n", power); printf("The random number is : %d\n", random); printf("The value of sqrt(2.25) is : %lf\n", sq_root); } // end of main Sample Output: Page 2 of 2
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '10
  • zaman
  • Continuous function, Logarithm, #include, Simple Standard Mathematical Library Functions

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes