Guest User

Untitled

a guest
Jan 21st, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. /*Mary Kwong*/
  2. #include <stdio.h> //printf, scanf functions
  3. #include <math.h> //math functions and operations
  4.  
  5. double celsius_at_depth(double kilometers);
  6. double fahrenheit(double kilometers);
  7.  
  8. int main(void)
  9. {
  10.     double kilometers
  11.     printf("Enter depth in kilometers=> ");
  12.     scanf("%lf", &kilometers);
  13.     printf("The temperature is %f degrees C or %f degrees F.\n",
  14.  
  15.  
  16. double celsius_at_depth(double kilometers)
  17. {
  18.     return ((10 * kilometers) + 20);
  19. }
  20.  
  21. double fahrenheit(double kilometers)
  22. {
  23.     return((((10 * kilometers) + 20) * (9 / 5)) + 32);
  24. }
Add Comment
Please, Sign In to add comment