#include <stdio.h>

#define NUM_ITER 10

int task( int y ); /* function prototype */


/* function main begins program execution */

int main( void )
{
   int x; /* counter */

   /* loop 10 times and calculate and output the result each time */
   for ( x = 1; x <= NUM_ITER; x++ ) 
   {
      printf( "%d  ", task( x ) ); /* function call */
   } /* end for */

   printf( "\n" );

   return 0; /* indicates successful termination */

} /* end main */


/* What does the following function do? */

int task( int y ) /* y is a copy of argument to function */
{
   return y * y; /* returns y * y as an int */

} /* end function task */


/* Note: if the function code is placed before main(), we do not need to declare the function prototype. */


