i need it to stop when uncut=total my orginal prog. is
#include%26lt;cmath%26gt;
#include%26lt;string%26gt;
#include%26lt;iostream%26gt;
using namespace std;
int main()
{
double total, uncut;
const double restrate=.02;
total = 14000;
uncut = 2500;
cout %26lt;%26lt; "Year..............Acres" %26lt;%26lt; endl %26lt;%26lt; endl;
for(int k=0; k%26lt;20; k++)
{
cout %26lt;%26lt; k+1 %26lt;%26lt; ".............." %26lt;%26lt; uncut %26lt;%26lt; endl;
uncut += restrate * uncut;
}
getchar();
return 0;
}
C++ modify program?
if(uncut==total) break;
Reply:add this line after uncut += restrate * uncut;
if (uncut==total) return 0;
cheap flowers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment