How do I convert these intructions to code Im taking a programming with C class
// include the header file for stdio // include the header file for C mathematical library functions // function prototypes for two functions: // square: it is a function that receives a double value // and returns the square of the incoming value // sqroot: it is a function that receives a double value // and returns the square root of the incoming value int main( ) { double d; print( "please type a double: " ); scanf( "%lf", &d ); // display the value of d using %7.2lf // display the square of d using %7.2lf // display the square root of d using %7.2lf return 0; } // write the function square( ) double square( double x ) { // compute and return the square value of x } // write the function sqroot( ) // compute and return the square root value of x
Log in to comment