- 5.4 Figure 5.8 Displaying a Celsius-to-Fahrenheit Conversion Table
#include <iostream>
#define cbegin 10
#define climit -5
#define cstep 5
using namespace std;
int main(int argc, char *argv[])
{
int celcius;
double fahrenheit;
cout<<"Celcius \tFahrenheit"<<endl<<endl;
for (celcius=cbegin;celcius>=climit;celcius -= cstep) {
fahrenheit= 1.8*celcius+32.0;
cout<<"celcius "<<celcius<<"\tfahrenheit "<<fahrenheit<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
RUN :
0 komentar:
Posting Komentar