+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2008
    Location
    PA
    Posts
    1,164
    Points
    4,021,175.25
    Rep Power
    221

    Default Temperature Converter [C++]

    Try it out HERE
    Code:
    // SonniE's Temperature Converter a www.codinghs.com Original 
    #include <iostream>
    using namespace std;
    int main()
    {
        
        double faren, temp, celc;
        char type;
        cout << "Welcome To SonniE's Temperature Converter! \n";
        cout << "What Unit of Temperature do u have? \n";
        cout << "Enter c for celcius or f for farenheight: ";
        cin >> type;
        cout << "\n Enter The Temperature: ";
        cin >> temp;
        if (type == 'c')
        {
               faren = 1.8 * temp + 32.0;
               cout << "In Farenight That Temperature is: " << faren << "\n";
        system("PAUSE");
    }
    else 
    {
         celc = (temp - 32) * 1.8;
         cout << "In Celcius That Temperature is: " << celc << "\n";
        system("PAUSE");
    }
    return 0;
    }
    Last edited by SonniE; 05-25-2008 at 06:43 AM.


    Get Vip: »Here«
    Donate: »Here«
    >>List of Compilers<<
    >>SFDM Name Generator<<
    [Owner Of FluidCoding]

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts