User Tag List

Results 1 to 6 of 6

Thread: C++ HexCalculator Example

  1. #1
    C++ HexCalculator Example

    User Info Menu

    C++ HexCalculator Example

    Code:
    /*
    
    Made by TheEliteOne
    Language: C++
    HexCalculator Example
    Open Source
    
    */
    
    #include <iostream>
    #include <windows.h>
    using namespace std;
    int main()
    {
        system("cls");
        system("title TheEliteOne's HexCalculator");
    
        int num1, num2;
    
        cout << "Input a hexadecimal number: 0x";
        cin >> hex >> num1;
        cout << "\nInput a hexadecimal number: 0x";
        cin >> hex >> num2;
        system("cls");
    
        cout << "0x" << hex << num1 << " + 0x" << hex << num2 << " = 0x" << hex << num1 + num2 << "\n";
        cout << "0x" << hex << num1 << " - 0x" << hex << num2 << " = 0x" << hex << num1 - num2 << "\n";
        cout << "0x" << hex << num1 << " * 0x" << hex << num2 << " = 0x" << hex << num1 * num2 << "\n";
        cout << "0x" << hex << num1 << " / 0x" << hex << num2 << " = 0x" << hex << num1 / num2 << "." << hex << num1 % num2 << "\n\n";
    
        system("pause");
        return main();
    }

    If you have an idea on a PSP related program that is ran on Windows PM me with some information on your idea please.

  2. #2
    Life is never fair

    User Info Menu

    Re: C++ HexCalculator Example

    Not bad. Real simple.
    What I don't get is why do you put windows.h if your not making any type of forms or window.

  3. #3
    C++ HexCalculator Example

    User Info Menu

    Re: C++ HexCalculator Example

    Quote Originally Posted by j2eco7V View Post
    Not bad. Real simple.
    What I don't get is why do you put windows.h if your not making any type of forms or window.
    If you use Code::Blocks then you need to include windows.h if you use system commands such as system("pause"); and system("cls");

    If you have an idea on a PSP related program that is ran on Windows PM me with some information on your idea please.

  4. #4
    Life is never fair

    User Info Menu

    Re: C++ HexCalculator Example

    Ohh ight. I didn't know. I have it installed, but I never used it. I usually use DevC++.

  5. #5
    C++ HexCalculator Example

    User Info Menu

    Re: C++ HexCalculator Example

    Quote Originally Posted by j2eco7V View Post
    Ohh ight. I didn't know. I have it installed, but I never used it. I usually use DevC++.
    You should try Code::Clocks, it is better imo.

    If you have an idea on a PSP related program that is ran on Windows PM me with some information on your idea please.

  6. #6
    Life is never fair

    User Info Menu

    Re: C++ HexCalculator Example

    Quote Originally Posted by TheEliteOne View Post
    You should try Code::Clocks, it is better imo.
    Well I actually haven't done anything in a long time. I've actually started to try and learn Zune Game and App development.

Bookmarks

Posting Permissions

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