This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Homework #5 /* * Program: Hw5_1 * Written by Justin Waters * Inputs:User enters numbers and a math operation to be performed * Outputs: It outputs the calculated number * Description: The user enters a number then a math function and back and forth until he decides to quit, then the final result is given * */ #include <stdio.h> #include <math.h> //declare functions char get_operator(void); double get_number(void); double calculate(double old_result); void explain(void); double plus(double old_result); double minus(double old_result); double mult(double old_result); double divide(double old_result); double remain(double old_result); double power(double old_result); int main(void) { double result, final_result; explain(); //calls function to tell user about the program result = get_number(); //calls function to get 1st number and start loop final_result = calculate(result); //calls function to get final result //prints final result printf("The final result is: %f\nThank you.\n", final_result); return(0); }...
View
Full
Document
 Spring '08
 Parikh
 final result, #include, Justin Waters, final result printf

Click to edit the document details