fork download
  1. //Week3.cpp
  2. //Sandy Div
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9. float fahrenheit, celsius;
  10.  
  11. float beach = 80;
  12. float hiking1 = 65 ,hiking2 = 70;
  13. float sightseeing1 = 40, sightseeing2 = 65;
  14. float skiing1= 25, skiing2=40;
  15. float reading = 25;
  16.  
  17.  
  18. printf("\nAbove %.0f beach", beach);
  19.  
  20. printf("\nBetween %.0f and %.0f hiking", hiking1, hiking2);
  21.  
  22. printf("\nBetween %.0f and %.0f sightseeing", sightseeing1,sightseeing2);
  23.  
  24. printf("\nBetween %.0f and %.0f skiing", skiing1, skiing2);
  25.  
  26. printf("\nBelow %.0f reading", reading);
  27.  
  28.  
  29. //Convert Fahrenheit to Celsius
  30.  
  31. printf("\nEnter Fahrenheit temperature: ");
  32. scanf("%.0f", &fahrenheit);
  33.  
  34. celsius= (fahrenheit - 32)/ 1.8;
  35.  
  36. printf("\nCelsius conversion : %.0f", celsius);
  37.  
  38. return 0;
  39. }
Success #stdin #stdout 0s 3300KB
stdin
Standard input is empty
stdout
Above 80 beach
Between 65 and 70 hiking
Between 40 and 65 sightseeing
Between 25 and 40 skiing
Below 25 reading
Enter Fahrenheit temperature: 
Celsius conversion : -18