17: else
18: cout << “a-b does not equal c: “;
19: return 0;
20: }
- Enter the program from Exercise 2; compile, link, and run it. Enter the numbers
20, 10, and 50. Did you get the output you expected? Why not? - Examine this program and anticipate the output:
1: #include
2: using namespace std;
3: int main()
4: {
5: int a = 2, b = 2, c;
6: if (c = (a-b))
7: cout << “The value of c is: “ << c;
8: return 0;
9: }
Enter, compile, link, and run the program from Exercise 4. What was the output? Why?
98 Day 4