it says-missing statment on line 10, why?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Karin Levy
    New Member
    • Nov 2011
    • 1

    it says-missing statment on line 10, why?

    Code:
    #include <iostream.h>;
    #include <stdlib.h>;
    #include <math.h>;
    
    void main ()
    {
    
     float i , A1(1),  asmpv1(0.00) , asmpv2(0.00) , asmpv3(0.00) , asmpv4(0.00) , sum(1);
     asmpv1 = (1 ^ 2)/4.00);
     cout << " For n=1 the asumption value is " << asmpv1 << endl;
     cout << " A1 = " << A1 << endl;
     cout << " The diff is " << abs(asmpv1-A1) << endl;
    
    
      for ( i = 2 ; i<=10 ; i++ )
      			sum += sqrt(sum);
      asmpv2 = ((10 ^ 2)/4);
      cout << " For  n=10 the asumption value is "  << asmpv2 << endl;
      cout << " A10 = " << sum << endl;
      cout << " The diff is " << abs(asmpv2-sum) << endl;
    
    
      for ( i = 11 ; i<=100 ; i++ )
      			sum += sqrt(sum);
      asmpv3 = ((100 ^ 2)/4);
      cout << " For  n=100 the asumption value is "  << asmpv3 << endl;
      cout << " A100 = " << sum << endl;
      cout << " The diff is " << abs(asmpv3-sum) << endl;
    
    
      for ( i = 101 ; i<=1000 ; i++ )
      			sum += sqrt(sum);
      asmpv4 = ((1000 ^ 2)/4);
      cout << " For  n=1000 the asumption value is "  << asmpv4 << endl;
      cout << " A1000 = " << sum << endl;
      cout << " The diff is " << abs(asmpv4-sum) << endl;
    
    
      system ("pause");
     }
    Last edited by Banfa; Nov 21 '11, 09:39 AM. Reason: Added [code]...[/code] tags round the code. Please do no make code only posts, explain you problem fully.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Check your C++ book for the ^ operator.

    Comment

    Working...