Sunday, August 2, 2009

Question in c++ for square roots?

include %26lt;conio.h%26gt;// needed for getch


#include %26lt;iostream.h%26gt;//needed for cout message


#include %26lt;math.h%26gt;// need got math


#include %26lt;iomanip.h%26gt;//


#include %26lt;string.h%26gt;// needes for strings


void startup();


void method(double sqrt(double num));


int main()


{


startup();


method(double sqrt(double num));


getch();


return 0;


}


void startup()


{


cout%26lt;%26lt;""%26lt;%26lt;'\n';


cout%26lt;%26lt;"Jan 24, 2008"%26lt;%26lt;'\n';


cout%26lt;%26lt;"pg162 problem 9.1.2"%26lt;%26lt;'\n';


cout%26lt;%26lt;""%26lt;%26lt;'\n';


}


void method(double sqrt(double num))


{


int num;


cout%26lt;%26lt;"Enter a number to be squared rooted: ";


cin%26gt;%26gt;num;


cout%26lt;%26lt;num;


}


i'm trying to find the sqrt of the number the user is going to enter but my book just says that the function is sqrt. plz help. thx





sry there is more, i have to make the outcome as like if the num is 45 then it should equal 3 times square root of 5. help plzz thx

Question in c++ for square roots?
#include %26lt;conio.h%26gt;// needed for getch


#include %26lt;iostream.h%26gt;//needed for cout message


#include %26lt;math.h%26gt;// need got math


#include %26lt;iomanip.h%26gt;//


#include %26lt;string.h%26gt;// needes for strings





void startup();


void method();





int main()


{


startup();


method();


getch();


return 0;


}


void startup()


{


cout%26lt;%26lt;""%26lt;%26lt;'\n';


cout%26lt;%26lt;"Jan 24, 2008"%26lt;%26lt;'\n';


cout%26lt;%26lt;"pg162 problem 9.1.2"%26lt;%26lt;'\n';


cout%26lt;%26lt;""%26lt;%26lt;'\n';


}


void method()


{


int num;


cout%26lt;%26lt;"Enter a number to be squared rooted: ";


cin%26gt;%26gt;num;


cout%26lt;%26lt;sqrt(num);


}


No comments:

Post a Comment