Results 1 to 3 of 3

Thread: Why do i get this error???

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2001
    Posts
    18

    Question Why do i get this error???

    For some reason i keep getting this error in the following code
    error C2660: 'pow' : function does not take 1 parameters This error appears twice for the two lines that i am using pow can anyone please help me

    #include <iostream.h>
    #include <math.h>
    void main()
    {
    double a,b,c;
    double r1;
    double r2;
    cout<<"Please enter the a: ";
    cin>>a;
    cout<<"Please enter the b: ";
    cin>>b;
    cout<<"Please enter the c: ";
    cin>>c;
    r1 = (-1*b+pow((b*b-4*a*c)*0.5))/(2.0*a);
    r2 = (-1*b-pow((b*b-4*a*c)*0.5))/(2.0*a);
    if (r1>=0 && r2>=0)
    {
    cout<<"the roots are reals "<<endl;
    }
    else
    {
    cout<<"the roots are not real"<<endl;

    }
    if (r1 > r2)
    {
    cout<<"the largest root is "<<r1<<endl;
    }
    else
    {
    cout<<"the largest root is "<<r2<<endl;
    }
    }

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Code:
    double r;
    r = pow(13, 3);
    // thirteen to the third power
    pow(double arg1, double arg2)

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Seems like you've lost track of your own code (is it?).

    Bad thing if that happens...
    But for once MSVC++ gives an error message that is actually comprehensible
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width