fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main(){
  5.  
  6. double i, faren=0, c, maxCount, incr;
  7. cout << "Celcicus" << setw(15) <<"Faren.\n";
  8.  
  9. cout <<setiosflags(ios::showpoint) << setiosflags(ios::fixed) <<setprecision(1);
  10. for (i=0; i<=100; i++){
  11. faren= i*9/5+32;
  12. cout << i << setw(15) << faren <<endl;
  13. }
  14.  
  15. cout << "\nWhat temp would you like to start at? ";
  16. cin >> c;
  17.  
  18. cout << "\nHow high would you like to count? ";
  19. cin >> maxCount;
  20.  
  21. cout << "\nWhat number would you like to count by?";
  22. cin >> incr;
  23. i=c;
  24. cout << endl;
  25. cout << "Celcicus" << setw(15) <<"Faren.\n";
  26.  
  27. for (i=c; i < maxCount; i+=incr){
  28. faren= i*9/5+32;
  29. cout << i << setw(15) << faren << endl;
  30. }
  31.  
  32.  
  33.  
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 2860KB
stdin
10
100
10
stdout
Celcicus        Faren.
0.0           32.0
1.0           33.8
2.0           35.6
3.0           37.4
4.0           39.2
5.0           41.0
6.0           42.8
7.0           44.6
8.0           46.4
9.0           48.2
10.0           50.0
11.0           51.8
12.0           53.6
13.0           55.4
14.0           57.2
15.0           59.0
16.0           60.8
17.0           62.6
18.0           64.4
19.0           66.2
20.0           68.0
21.0           69.8
22.0           71.6
23.0           73.4
24.0           75.2
25.0           77.0
26.0           78.8
27.0           80.6
28.0           82.4
29.0           84.2
30.0           86.0
31.0           87.8
32.0           89.6
33.0           91.4
34.0           93.2
35.0           95.0
36.0           96.8
37.0           98.6
38.0          100.4
39.0          102.2
40.0          104.0
41.0          105.8
42.0          107.6
43.0          109.4
44.0          111.2
45.0          113.0
46.0          114.8
47.0          116.6
48.0          118.4
49.0          120.2
50.0          122.0
51.0          123.8
52.0          125.6
53.0          127.4
54.0          129.2
55.0          131.0
56.0          132.8
57.0          134.6
58.0          136.4
59.0          138.2
60.0          140.0
61.0          141.8
62.0          143.6
63.0          145.4
64.0          147.2
65.0          149.0
66.0          150.8
67.0          152.6
68.0          154.4
69.0          156.2
70.0          158.0
71.0          159.8
72.0          161.6
73.0          163.4
74.0          165.2
75.0          167.0
76.0          168.8
77.0          170.6
78.0          172.4
79.0          174.2
80.0          176.0
81.0          177.8
82.0          179.6
83.0          181.4
84.0          183.2
85.0          185.0
86.0          186.8
87.0          188.6
88.0          190.4
89.0          192.2
90.0          194.0
91.0          195.8
92.0          197.6
93.0          199.4
94.0          201.2
95.0          203.0
96.0          204.8
97.0          206.6
98.0          208.4
99.0          210.2
100.0          212.0

What temp would you like to start at? 
How high would you like to count? 
What number would you like to count by?
Celcicus        Faren.
10.0           50.0
20.0           68.0
30.0           86.0
40.0          104.0
50.0          122.0
60.0          140.0
70.0          158.0
80.0          176.0
90.0          194.0