1 / 14

Math Library Functions

03/01/10. Math Library Functions. Programs 1 and 2 Grades. Use mutt to read email on onyx to find out your program grade. .forward could also be used for future assignments.Use functions from the math.h library to do special calculations. Objective.

samira
Télécharger la présentation

Math Library Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 03/01/10 Math Library Functions

  2. Programs 1 and 2 Grades Use mutt to read email on onyx to find out your program grade. .forward could also be used for future assignments.Use functions from the math.h library to do special calculations.

  3. Objective Use functions from the math.h library to do special calculations.

  4. Side of Bandana Problem I am manufacturing bandanas. Given the amount of cloth I can afford for each bandana, I want to know the measure of the side of that square. Write a program to find out the measure of the side of the square bandana.

  5. Algorithm 1. Input area 2. 3. Output side

  6. Program bandana.c

  7. Built-in Functions Call Syntax: fname(arg1, arg2,… argn)‏ Example: s = sqrt(area); Include #include <math.h> Must use -lm option when compiling gcc -lm prog.c

  8. Some Functions in cmath

  9. Some Functions in cmath

  10. Absolute Value of Integers

  11. More Functions in cmath • Examples log(88.5) --> 4.483 exp(4.483) --> 88.5

  12. Example Write a program to find the 4th root of a number input by the user. fourthRoot.c

  13. Find Age Difference Write a program to find the difference in age between two quarterbacks on a team.

  14. Algorithm Input qb1 and qb2 difference = |qb1 – qb2| Output difference Write the program today in lab. Started in qb.c

More Related