A
arnuld
this is my final code. Can you folks advise some improvements for
making this programme better?
BTW, i aways compile my programme with this cmmand on Linux:
g++ -ansi -pedantic -Wall -Wextra file.cpp
// a programme that converts Fahrenheit
temperature
// to Celcius (in range 0 -
300)
#include <iostream>
int main() {
int fahr, cel;
const int lower = 0;
const int upper = 300;
const int stepper = 20;
fahr = lower;
while (fahr <= upper)
{
cel = (5 * (fahr - 32)) / 9;
std::cout << fahr
<< "F \t"
<< cel
<< "C"
<< "\n";
fahr = fahr + stepper;
}
return 0;
}
making this programme better?
BTW, i aways compile my programme with this cmmand on Linux:
g++ -ansi -pedantic -Wall -Wextra file.cpp
// a programme that converts Fahrenheit
temperature
// to Celcius (in range 0 -
300)
#include <iostream>
int main() {
int fahr, cel;
const int lower = 0;
const int upper = 300;
const int stepper = 20;
fahr = lower;
while (fahr <= upper)
{
cel = (5 * (fahr - 32)) / 9;
std::cout << fahr
<< "F \t"
<< cel
<< "C"
<< "\n";
fahr = fahr + stepper;
}
return 0;
}