0

every time i input in Temp the value of Cel remains zero, why expression is not storing value in it?

#include<iostream>

using namespace std;

int main(){
    float Far, Cel, Temp;
    char choice;

    cout << " To convert from Celcius to Farenheit, press 'f' for opposite 'c': "<<endl;
    cin >> choice;

    cout << "Enter Temperature: " << endl;
    cin >> Temp;

    if(choice == 'f' || choice == 'F'){
            Far = (Temp*(9/5))+32;
            cout <<  "Temperature in Farenheit is: " << Far << endl;
    }
    else if(choice == 'c' || choice == 'C'){
            Cel = (Temp - 32) * (5/9);
            cout << "Temperature in Celcius is: " << Cel << endl;
    }

    return 0;
}
A.F.R.N
  • 11
  • 1
  • 6

0 Answers0