How To Get Rich On A 1-Cent Week
public cpp v1 · immutable#include <iostream>using namespace std;int main (){ int payment2; int payment = 1; int profit = 1; int weeks = 1;// these are initialized to accomodate the first week. do { payment2 = payment * 2; payment = payment2; profit = profit + payment; weeks++; } while (profit < 100000000); // 100,000,000 cents = $1,000,000 cout << "In " << weeks << " weeks, I will be a millionaire!"; return 0;}