Skip to content
Physics and Astronomy
Home Our Teaching Resources C programming A short example
Back to top

Functions: a complete example using prototypes

The following example is intended to show main() calling a function that in turn calls another function:

  1. main() calls the function printexp(double x, int j) whose job is to print out x to the power j.
  2. printexp() in turn calls mypow() to do the actual calculation.
 
Log in
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Privacy & cookies Share
Back to top