Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int temp_change(fahrenheit);
  5.  
  6. int main()
  7. {
  8. while(1)
  9. {
  10. int fahrenheit;
  11. printf("Please input a temperature in Fahrenheit.n");
  12. scanf("%d", &fahrenheit); //Obtains degrees F value
  13. printf("%dn", temp_change(fahrenheit));
  14.  
  15. }
  16. }
  17. //Function to change temperature
  18. int temp_change(fahrenheit)
  19. {
  20. int centigrade;
  21. centigrade = 5*(fahrenheit - 32)/9; //Changing the temperature
  22. return centigrade;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement