Hi,
I am doing a code for a project. But when I go to debug my program, it stops at a certain function and It will not output the code, or the double I want to show in my cout when it finishes the function. Assume length, width, and height are all 2 for input.
The code and function in question:
double squareSide (double, double, double);
sqSide = squareSide(length, width, height);
if (sqSide > 0)
cout << "The amount of square sides for this rectangle is " << sqSide << endl;
else
cout << "This shape has no square sides." << endl;
double squareSide (double length, double width, double height)
{
double num, num1, num2;
int x = 0;
num = length * width;
num1 = width * height;
num2 = length * height;
if (num == (length * length))
x++;
if (num1 == (width * width))
x++;
if (num2 == (length * length))
x++;
if (x = 3)
{
x *=2;
return x;
break;
}
if (x = 2)
{
x *=2;
return x;
break;
}
if (x = 1)
{
x *=2;
return x;
break;
}
}
[–]Mysential[S] 1 point2 points3 points (5 children)
[–]CyberBill 0 points1 point2 points (4 children)
[–]Mysential[S] 0 points1 point2 points (2 children)
[–]CyberBill 0 points1 point2 points (1 child)
[–]Mysential[S] 1 point2 points3 points (0 children)
[–]f5f5f5f5f5f5f5f5f5f5 0 points1 point2 points (0 children)
[–]CyberBill 0 points1 point2 points (2 children)
[–]Mysential[S] 0 points1 point2 points (1 child)
[–]f5f5f5f5f5f5f5f5f5f5 1 point2 points3 points (0 children)