Homework5-1

# Homework5-1 - Homework#5 Program Hw5_1 Written by Justin...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the 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

{[ snackBarMessage ]}

### Page1 / 4

Homework5-1 - Homework#5 Program Hw5_1 Written by Justin...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online