I am trying to make a converter between Celsius and Fahrenheit but I have a problem. When I run my code end enter "Celsius to Fahrenheit" it is terminated. Here is my code:
#include <iostream>
int main() {
std::string ftc;
int f;
int c;
std::cout << "Celsius to Fahrenheit or Fahrenheit to Celcius ";
std::cin >> ftc;
if(ftc == "Celsius to Fahrenheit") {
std::cout << "(c to f) Please provide input ";
std::cin >> c;
f = (c*1.8)+32;
std::cout << f;
} else if(ftc == "Fahrenheit to Celsius") {
std::cout << "(f to c) Please provide input ";
std::cin >> f;
c = (f-32)*0.5556;
std::cout << c;
}
}