fork download
  1. // Castulo Jason Quintero CSC5 Chapter 5 homework, pg. 296 #12
  2. //
  3. /**************************************************************************
  4.  * COMPUTE AND DISPLAY CELCIUS TO FARENHEIT CONVERSION
  5.  * ________________________________________________________________________
  6.  * This program converts Celsius temperature to Fahrenheit
  7.  * temperatures and displays the results in a table.
  8.  *
  9.  * Computation is based on the formula:
  10.  * Fahrenheit = (9/5 * C ) + 32
  11.  * ________________________________________________________________________
  12.  * INPUT
  13.  * Celsius: temperature in Celsius input by the user
  14.  *
  15.  * OUTPUT
  16.  * Fahrenheit : temperature in Fahrenheit
  17.  *************************************************************************/
  18. #include <iostream>
  19. #include <iomanip>
  20. using namespace std;
  21.  
  22. int main()
  23. {
  24. float Fahrenheit;
  25. float Celsius;
  26. Celsius= 0;
  27.  
  28. cout << "Celsius:" << "\t" << "Fahrenheit:" << endl;
  29. cout << "-----------------------\n";
  30.  
  31. for (Celsius=0; Celsius <=20; Celsius++)
  32. {
  33. Fahrenheit = Fahrenheit = ((9.0/5.0) * Celsius) + 32;
  34.  
  35. cout << Celsius << "\t\t\t" << Fahrenheit << endl;
  36. }
  37.  
  38. return 0;
  39. }
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
Celsius:	Fahrenheit:
-----------------------
0			32
1			33.8
2			35.6
3			37.4
4			39.2
5			41
6			42.8
7			44.6
8			46.4
9			48.2
10			50
11			51.8
12			53.6
13			55.4
14			57.2
15			59
16			60.8
17			62.6
18			64.4
19			66.2
20			68