Chapter 6: Problem 53
Find the error in each of the following program segments and explain how to correct it: a. float cube( float ); // function prototype double cube( float number ) // function definition { return number * number * number; } b. register auto int x = 7; c. int randomNumber = srand(); d. float y = 123.45678; int x; x = y; cout << static_cast < float > ( x ) << endl; e. double square( double number ) { double number; return number * number; } f.int sum( int n ) { if ( n == 0 ) return 0; else return n + sum( n ); }
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.