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

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 1 Created by David Mann, North Idaho College.
Advertisements

Copyright © 2002 Pearson Education, Inc. Slide 1.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 10 – Enhancing the Wage Calculator Application:
BBS514 Structured Programming (Yapısal Programlama)1 Functions and Structured Programming.
Lecture 10: Don't Reinvent the Wheel. Exam Results.
Chapter 5 C Functions The best way to develop and maintain a large program is to divide it into several smaller program modules, each of which is more.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program Modules in C 5.3Math Library Functions 5.4Functions.
Chapter 6: User-Defined Functions I
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
FunctionsFunctions Systems Programming. Systems Programming: Functions 2 Functions   Simple Function Example   Function Prototype and Declaration.
 2007 Pearson Education, Inc. All rights reserved C Functions.
C++ Programming: From Problem Analysis to Program Design, Second Edition Chapter 6: User-Defined Functions I.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
 2007 Pearson Education, Inc. All rights reserved C Functions.
Chapter 6: User-Defined Functions I
Copyright © 2010 Pearson Education, Inc. All rights reserved Sec
 2000 Prentice Hall, Inc. All rights reserved. Functions in C Outline 1Introduction 2Program Modules in C 3Math Library Functions 4Functions 5Function.
FunctionsFunctions Systems Programming Concepts. Functions   Simple Function Example   Function Prototype and Declaration   Math Library Functions.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. C How To Program - 4th edition Deitels Class 05 University.
 2007 Pearson Education, Inc. All rights reserved C Functions.
Lecture6 Recursion function © by Pearson Education, Inc. All Rights Reserved. 1.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 10 – Enhancing the Wage Calculator Application:
Functions in C Outline 1Introduction 2Program Modules in C 3Math Library Functions 4Functions 5Function Definitions 6Function Prototypes 7Header Files.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Section 3.4 Library of Functions; Piecewise-defined Functions.
Section 3.4 Library of Functions; Piecewise-defined Functions Copyright © 2013 Pearson Education, Inc. All rights reserved.
Programming in C++ Language ( ) Lecture 5: Functions-Part1 Dr. Lubna Badri.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 6 September 17, 2009.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Functions (Header files and Library Functions) Outline.
Lecture 13: Working with Multiple Programmers. Headers Header files: Each standard library has a corresponding header. The function prototype for all.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 5 - Functions Outline 5.1Introduction 5.2Program.
CGS 3460 Preprocessor n All preprocessor directives or commands begin with a #. lE.g. #include C program → Modified C program → Object Code n Can appear.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Functions Outline 5.1Introduction 5.2Program Modules.
C++ Programming Lecture 9 Functions – Part I By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
KIC/Computer Programming & Problem Solving 1.  Introduction  Program Modules in C  Math Library Functions  Functions  Function Definitions  Function.
TMC1414/TMC1413 I NTRODUCTION T O P ROGRAMMING Lecture 06 Function.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 6: User-Defined Functions I.
Copyright © 2010 Pearson Education, Inc. All rights reserved Sec Radical Expressions and Graphs.
Chapter 3: User-Defined Functions I
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 6: User-Defined Functions I.
 2000 Prentice Hall, Inc. All rights reserved Introduction Divide and conquer –Construct a program from smaller pieces or components –Each piece.
CHAPTER 4 FUNCTIONS Dr. Shady Yehia Elmashad. Outline 1.Introduction 2.Program Components in C++ 3.Math Library Functions 4.Functions 5.Function Definitions.
Dale Roberts CSCI N305 Functions Declarations Department of Computer and Information Science, School of Science, IUPUI.
 2000 Prentice Hall, Inc. All rights reserved Program Components in C++ Function definitions –Only written once –These statements are hidden from.
Section 8.2 The Inverse Trigonometric Functions (Continued) Copyright © 2013 Pearson Education, Inc. All rights reserved.
L131 Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips rand( ) math library functions Reading Sections.
14.0 Math Review 14.1 Using a Calculator Calculator
BIL 104E Introduction to Scientific and Engineering Computing Lecture 4.
Dr. Shady Yehia Elmashad
25 Math Review Part 1 Using a Calculator
CSC113: Computer Programming (Theory = 03, Lab = 01)
Deitel- C:How to Program (5ed)
Dr. Shady Yehia Elmashad
Chapter 5 - Functions Outline 5.1 Introduction
Functions.
Chapter 5 - Functions Outline 5.1 Introduction
Dr. Shady Yehia Elmashad
Quadratic Equations, Inequalities, and Functions
Preprocessor C program → Modified C program → Object Code
2011/11/10: Lecture 21 CMSC 104, Section 4 Richard Chang
Tip Calculator App Android How to Program
The Inverse Trigonometric Functions (Continued)
Roots, Radicals, and Root Functions
Piecewise-defined Functions
Section 10.5 The Dot Product
Unit 4 Review Answers.
Functions in C Math Library Functions Functions Function Definitions
Presentation transcript:

© 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( ) ); 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

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

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

© 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

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