cout << I'm;
if (i >= m)
cout << Cow;
else
cout << Adam;
4. Given the int variables x, y, and z, where x is 3, y is 7, and z is 6, what is the output from each of the following code fragments?
a. if (x <= 3)
cout << x + y << endl;
cout << x + y << endl;
b. if (x != -1)
cout << The value of x is < x << endl;
else
cout << The value of y is < y << endl;
c. if (x != -1)
{
cout << x endl;
cout << y << endl;
cout << z << endl;
}
else
cout << y << endl;
cout << z << endl;
5. Given this code fragment:
if (height >= minHeight)
if (weight >= minWeight)
cout << Eligible to serve. << endl;
else
cout << Too light to serve. << endl;
else
if (weight >= minWeight)
cout << Too short to serve. << endl;
else
cout << Too short and too light to serve. << endl;
a. What is the output when height exceeds minHeight and weight exceeds minWeight?
b. What is the output when height is less than minHeight and weight is less than minWeight?
6. Match each logical expression in the left column with the logical expression in the right column that tests for the same condition.