Today in class we discussed multiway branches. A regular branch can only give you one of two outcomes. In a multiway branch since there are branches within branches, there can be more possibilities.
Example:
if (guess > number)
cout << "Too high.";
else if (guess < number)
cout << "Too low.";
else if (guess == number)
cout << "Correct!";
No comments:
Post a Comment