/*********************************************************** functions.ch Functions This program introduces the user to the definition and use of functions ************************************************************ Copyright 2014 SoftIntegration Inc. http://www.softintegration.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ***********************************************************/ //Definition of f(x) double f(double x) { double result; //Feel free to change the function in the next line result = (x*x) + (4*x) + 9; return result; } //What is the result of the function if we pass in a particular number? double x, y; printf("What is x? "); scanf("%lf", &x); y = f(x); printf("f(%.2lf) = %.2lf\n", x, y);