Google
 
Webcprogramming.com




An Affiliate of AIHorizon




sqrt()

Prototype: double sqrt(double Value);
Header File: math.h (C) or cmath (C++)
Explanation: Returns the square root of Value. Probably not a good idea to try a negative number for Value...



Example:
//Example will give sqare root of numbers 1 to 10
#include <cmath>
#include <iostream>

using namespace std;

int main()
{
    for(int x = 1; x < 11; x++)
    {
        cout<<"Square root of: "<<x<<" is "<<sqrt(x)<<endl;
    }
}
Other Functions

Bookmark and Share



-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.
Designs