c++ Program for Temperature Conversion

c++ Program for Temperature Conversion


// Program to find Maximum of Three Numbers
// using ElseIf ladder and Logical Operator.

#include <iostream>
using namespace std;

int main()
{
     

int choice;
     float temp, cnvtemp;

     cout << "
 Temp. conversation menu : ";
     cout << "
 1. farenhit to celsius.";
     cout << "
 2. celsius to farenhit.";
     cout << "
 Enter your choice  : ";
     cin >> choice;

     if(choice == 1)
     {
          cout << "
 Enter temp. in farenheit : ";
          cin >> temp;
          cnvtemp = (temp-32) / 1.8;
          cout << "
 The temp in celsius is = " << cnvtemp;
     }
     else
     {
          cout << "
 Enter temp in celsius : ";
          cin >> temp;
          cnvtemp = (1.8 * temp) + 32;
          cout << "
 The temp in farenhit is = " << cnvtemp;
     }






}