fork download
  1. #include <stdio.h>
  2.  
  3. #define C_TO_F_RATIO 1.8
  4. #define C_TO_F_ADDITION 32
  5.  
  6. float tempC;
  7. float tempF;
  8.  
  9. #define CONVERT_TO_F(tempC) ((tempC * C_TO_F_RATIO) + C_TO_F_ADDITION)
  10.  
  11. int main(void)
  12. {
  13.  
  14. printf("\nPlease enter the temperature in Celcius: ");
  15. scanf("%f", &tempC);
  16.  
  17. tempF = CONVERT_TO_F(tempC);
  18. printf("\n\nTemperature Ferenheit: %.2f\n", tempF);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 5280KB
stdin
100
stdout
Please enter the temperature in Celcius: 

Temperature Ferenheit: 212.00