Posted by: wai_wai February 14, 2010
C++ adding fractions
Login in to Rate this Post:     0       ?        
logic should be like this ...correct me if i m wrong

double sum = 0.0;
            double m = 1;
            while(true)
            {             
                sum += 1/m;
                m++;
                if (m >10) break;

            }
//Print sum;
     
And btw i don't know C++    
Read Full Discussion Thread for this article