+ Reply to Thread
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    May 2008
    Posts
    4
    Points
    40.00
    Rep Power
    214

    Default

    hows about a hex to decimal converter..


    eg:

    #include <iostream>
    #include <iomanip>
    #include <string>

    using namespace std;

    int main( void )
    {
    string prompt = "Enter a hex value to convert, 0 to exit\n>";
    int val;

    do
    {
    cout << prompt;
    cin >> hex >> val;
    cout << "\n" << hex << val << " -> " << dec << val << "\n";
    } while( val );

    return 0;
    }

  2. #2
    Join Date
    May 2008
    Location
    In the interwebz
    Posts
    5,057
    Points
    2,346,735.99
    Rep Power
    238

    Default

    Quote Originally Posted by JamakianGangster View Post
    lol, this is all confusing
    What's there to be confused about?

  3. #3
    Join Date
    Jan 2008
    Location
    PA
    Posts
    1,164
    Points
    5,227,748.25
    Rep Power
    227

    Default

    Quote Originally Posted by SilverSurfer View Post
    hows about a hex to decimal converter..


    eg:

    #include <iostream>
    #include <iomanip>
    #include <string>

    using namespace std;

    int main( void )
    {
    string prompt = "Enter a hex value to convert, 0 to exit\n>";
    int val;

    do
    {
    cout << prompt;
    cin >> hex >> val;
    cout << "\n" << hex << val << " -> " << dec << val << "\n";
    } while( val );

    return 0;
    }
    nice job silver i might play with ur style later


    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