
32 Chapter 3
Program 21: No Comment
What does the following program print? Why?
1 /************************************************
2 * demonstrate how to do a divide. *
3 ************************************************/
4 #include <iostream>
5
6 /************************************************
7 * div -- Do a divide *
8* *
9 * Returns: Result of the divide. *
10 * *
11 * divisor is reset to 1. *
12 ************************************************/
13 static int div(
14 int *divisor // Pointer to the divisor
15 )
16 {
17 int result = 5; // Dividend
18
19 result=result/*divisor; /* Do divide */;
20 *divisor=1;
21 return (result);
22 }
23
24 int main()
25 {
26 intnum=5 ...