PDA
$threadinfo[title]
-


mesman00
May 3rd, 2002, 06:28
not to do with emulation either, but how do i find the square root of a number using c++.

one more thing... msdn (microsoft developers network), is it free, is it a web page, if not, how much does it cost, cuz i can really use a copy

LoneRaven
May 3rd, 2002, 08:42
Hey Mesman00 here is a sample program for find the square root of a number:


#include <math.h>
#include <stdio.h>
#include <stdlib.h>

void main( void )
{
double question = 49, answer;

answer = sqrt( question );
if( question < 0 )
printf( "Error: sqrt returns %.2f\n, answer" );
else
printf( "The square root of %.2f is %.2f\n", question, answer );
}


Hope it helps. :thumbsup:

mesman00
May 3rd, 2002, 08:46
alright, i thought i was told it was sqrt(), but never new it was in the math lib, thanks.

Cyberman
May 3rd, 2002, 12:39
Originally posted by mesman00
alright, i thought i was told it was sqrt(), but never new it was in the math lib, thanks.

Well try using the help :)
It should tell you what library it's in.. unless you are using DevC++ then you have to do it more yourself.

Math.h contains the function definitions for the library of mathematical functions as well as predefined things such as M_PI and M_PI2 etc.

Cyb

Slougi
May 3rd, 2002, 13:06
For msdn try http://msdn.microsoft.com. Also you can order it on CD I think.

Jsr
May 4th, 2002, 03:31
Originally posted by Slougi
For msdn try http://msdn.microsoft.com. Also you can order it on CD I think.
Yes, you install it as helpfiles if you have the cds.

mesman00
May 4th, 2002, 05:06
cant say i have the msdn cd's, so no help files