Quote:
Originally Posted by xpi0t0s View Post
The loop does not modify a. Look carefully at the 3rd clause in the for statement.
So a+.002 should be what I have listed below in red? If this is the case. I am still getting garbage answers.

Code:
 
#include<iostream>
#include<cmath>
using namespace std;
 
int main()
{
 
    double n,M,C,I,Sigma,b,h,a,x,i;
 
    n = 2.66;
    C = .020;
    M = 1500;
 
    for(a=0;a<=.020;a+=.002)
    {
 
           Sigma = (1500 * .020)/ ((1/12)*(.060)*pow(.040-2*a,3));
           cout<<Sigma<<endl;
     };
 
 
 
 
    system("pause");
    return 0;
 
}