Thread: help please

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    8

    help please

    Hi im kinda new to C++ and im trying to write a program for a challenge site (osix.net), but i seem to be running into problems with my loop which wont even seem to run once...

    Code:
    #include <iostream>
    
    using namespace std;
    
    double Perm = 3;
    int TimeTotal = 94;
    int TimePass = 0;
    
    int main()
    {
        while (TimePass < TimeTotal)
        {
            Perm = Perm * (1+1/3);
            TimePass++;
        }
    
        cout << (int)Perm;
    }
    If i take out the line TimePass++; the loop works but doesn't end......
    any help is appreciated!
    Last edited by comwizz2; 08-02-2007 at 12:07 PM. Reason: added info

Popular pages Recent additions subscribe to a feed