/* demo.c   P. Conrad  9/10/2004 */
/* program to demonstrate basics of input/output and function call and defn in C */

#include <stdio.h>

/* define a function "squared" */

double squared (double x)
{
  return x * x;
}


/************ main program **********/

void main(void)
{
  /* declare a variable */

  double num;

  /* prompt user for input */

  printf("Please enter a number: ");
  scanf("%lf", &num );

  /* echo back the number read in */
  
  printf("The number you typed in was: %lf \n", num);

  /* compute result, and print */

  printf("That number squared is %lf\n", squared(num));

  
  /* return 0; */
}

/* Show what happens when we run the program
   Show what happens if you use %f vs %lf, float vs. double
   Show what happens if the star slash at the end of the
     comment Prompt user for input is missing.
   Show what happens if you DON'T put in the \n 
   Show what happens if you forget the & in the scanf
   Show what happens if you put void main(void) instead of
      int main(void)

*/

