Square Roots

This is a discussion on Square Roots within the C++ Programming forums, part of the General Programming Boards category; I'm creating a roller coaster program. I need to find a way to get the squareroot of a given number. ...

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    907

    Square Roots

    I'm creating a roller coaster program. I need to find a way to get the squareroot of a given number. Does anybody know?
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    Unregistered
    Guest
    sqrt()

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    61
    Use the sqrt(); function in math.h this will take a number and return its square root.

    #include <math.h>
    double root;
    root = sqrt(16); // this will give you the square root of 16

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 06:57 PM
  2. Help with my draughts game
    By Zishaan in forum C++ Programming
    Replies: 9
    Last Post: 03-24-2007, 07:33 AM
  3. Simplifing Square Roots
    By LiNeAr in forum C++ Programming
    Replies: 11
    Last Post: 10-01-2005, 08:56 PM
  4. for loops using square roots, square, Cube
    By lotf in forum C Programming
    Replies: 3
    Last Post: 03-21-2004, 03:29 AM
  5. Square roots / Powers etc.
    By Robert602 in forum C++ Programming
    Replies: 4
    Last Post: 09-30-2001, 03:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21