Back to notes -- Keyboard shortcut: 'u'        next -- Keyboard shortcut: 'n'  Slide program -- Keyboard shortcut: 't'    Declarations before statements - C89 Style.Lecture 2 - slide 8 : 42
Program 1
double g(int a, double d){
  return a * d;
}

void f(double p){
  int i = 0;            
  double result;        // Local variable result declared before the first statement.

  //...
  if (p <= 10.0) i++;   // Some statements here              
  //...

  result = g(i,p);      // result first used much later in the function.

  /* The rest of f comes here */
}

int main(){
  f(5.0);
}