/* * Project1.c * Chapter 5 * John Stile * Purpose: Write a short program that has function that asks for and obtains * a float from the user, then returns it to whereever it is called. */ #include // include stdio.h functions when compiling float ask() // header for function float: returns float, takes nothing { float xx; // declare a floating point variable printf("Please enter a floating point number: "); // prompt user for input scanf("%f", &xx); //store input as float at address of xx return xx; } int main(void) { float yy; // declare a floating point variable yy=ask(); // call function printf("Your number was: %10f\n",yy); // Show the user thier number return 0; // return 0 to calling function }