Hint: Use for loops to input into your functions.
#include <iostream>
#include <cmath>
using namespace std;
double To_Celsius(double fahrenheit){
return (fahrenheit - 32.0) * 5.0 / 9.0;
}
double To_Fahrenheit(double celsius){
return celsius * 9.0 / 5.0 + 32.0;
}
void Print_EQ_Temps(){
for(int i=0; i>=-100;i--){
cout<<i<<"C = "<<To_Fahrenheit(i)<<"F\n";
}
cout<<"\n\n";
for(int i=32; i>=-212;i--){
cout<<i<<"F = "<<To_Celsius(i)<<"C\n";
}
}
int main() {
Print_EQ_Temps();
system("pause");
return 0;
}
Comments
Leave a comment