Advertisement
Sinux1

notes on topic 6 'functions'

Mar 15th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Topic 6 Funcions
  2. Slide 2
  3.  
  4. Ideas of funcions came out of math
  5.  
  6.  
  7.  
  8. f(x) = x^2 + x + 7
  9.  
  10. function name (parameter list) = Function body
  11.  
  12. so if f(4) --> take the parameter 4 and run it throught the function f and you get some outcome.
  13. Out come is the 'return type'
  14.  
  15. This chapter we will learn to use and write functions
  16.  
  17.  
  18. an example f functions we have already used
  19.  
  20.  
  21. #include <cmath>
  22.  
  23. cout << pow(4.0,3.0) << endl;
  24.  
  25.  
  26. The code for the function pow() lives in cmath, it takes the parameters with it to the function body, runs it, and returns the outcome which is out put to the console.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement