Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 3 of 3
  1. #1
    Regular Member
    Join Date
    Jul 2008
    Location
    Why are you reading this pedofile?
    Posts
    248

    Quick C++ Problem

    Okay, I am currently learning C++. I am taking a break to practice what I have learned so far. Here's the code at it's current stage, and yes wayyy unfinished. Oh BTW. I use Dev-CPP as my compiler. If you put this code you will see what's wrong much easier...if not, just look at it and tell me why it doesn't work. I can't figure it out.

    Code:
    #include <iostream>
    
    using namespace std;
    
    #define PI 3.14159
    #define NEWLINE '\n'
    
    int main()
    {
         int name;
    double r=5.0;               // radius
      double circle;
    
      circle = 2 * PI * r;
      cout << circle;
    
        cin >> name;
        }
        for ( int x = circle * 2; x < 300; x++) {
            cout<<"your name: "<<name<<" "<<x<<" number of times!!!\n";
            }
        cin.get();
    }

  2. #2
    Obsessed Veteran Adam's Avatar



    Join Date
    Nov 2004
    Location
    UK / England
    Posts
    17,271

    Re: Quick C++ Problem

    You should clearly state problems instead of expecting people to just compile code.

    Just from reading it I see you have a rogue brace;

    Code:
      
    cin >> name;
    }

  3. #3
    Regular Member
    Join Date
    Jul 2008
    Location
    Why are you reading this pedofile?
    Posts
    248

    Re: Quick C++ Problem

    lol thank you adam, and next time il be sure to state the problem completely. thread can be closed now.


 

Posting Permissions

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