More questions
Results 1 to 3 of 3

Thread: More questions

  1. #1
    Member
    Join Date
    Jul 2004
    Posts
    46

    More questions

    Well, first off, when using the #define preproccessor in C++, can I keep it empty and fill it in later for an if-else statement block? Or do I have to fill them in right after declaring them?


    Also, how would I set up my functions to do a math problem untill a certain result, printing the result given for each time it does the equation, untill it reaches that certain result, and then wait for the user to press a key before continuing?
    Tell me if you think I\'m spamming or doing something stupid, please.

  2. #2
    Keeping The Balance CybertecOne's Avatar
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    659
    math problem:

    let x = first number, let y = certain result...

    [equation including x]
    > if x != y > printf > loop > [equation including x]
    > if x = y > printf > pause > end

    hey, im not giving you the code when its that simple.... heh

    [edit]Mathematical functions work just like in a calculator + - * / [/edit]


    CTO
    "Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction."
    - Albert Einstein

  3. #3
    Member
    Join Date
    Jul 2004
    Posts
    46
    So it would be something like this?


    Code:
    if(x != y)
     {
      z = (x * y);
      cout << "Current result: " << z << '\n";
     }
    
    else
     {
      cout << 'We're done! YOU WIN DA PRIZE!!!";
     }
    Tell me if you think I\'m spamming or doing something stupid, please.

Posting Permissions

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