Firstly, sorry i posted this twice but i had connection problems and thought it hadnt posted the first time.
Here is my code for a box function.
and here is the output:Code:#include <iostream> using namespace std; void box(int length, int width, int height); int main() { box(7, 20, 4); box(50, 3, 2); box(8, 6, 9); return 0; } void box(int length, int width, int height) { cout << "The volume of the box is " << length * width * height << "\n"; }
The volume of the box is 560
In the book im using the output is this:
volume of box is 560
volume of box is 300
volume of box is 432
why is my code only outputting the first line?
ive checked the code and i can't spot any mistakes. Im ahaving the same problem with other function codes. Please help. Thanks



LinkBack URL
About LinkBacks




CornedBee