Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 5.3Math Library Functions Math library functions –perform.

Similar presentations


Presentation on theme: "© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 5.3Math Library Functions Math library functions –perform."— Presentation transcript:

1 © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 5.3Math Library Functions Math library functions –perform common mathematical calculations –#include Format for calling functions –FunctionName( argument ); If multiple arguments, use comma-separated list –printf( "%.2f", sqrt( 900.0 ) ); Calls function sqrt, which returns the square root of its argument All math functions return data type double –Arguments may be constants, variables, or expressions

2 © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Math Library Functions

3 © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Data types

4 © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 5.7Header Files Header files –Contain function prototypes for library functions –,, etc –Load with #include #include Custom header files –Create file with functions –Save as filename.h –Load in other files with # include "filename.h" –Reuse functions

5 © Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Header Files


Download ppt "© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 5.3Math Library Functions Math library functions –perform."

Similar presentations


Ads by Google