summaryrefslogtreecommitdiff
path: root/5p7.cpp
blob: fcc850bc0048eb1a46691bc4fb3bc05379ad6d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>

/*
 *
 * 5.7
 *
 *
 */

int get_value() {

	return 373;
}

int main () {

	int ival1 = 50;
	int ival2 = 100;
	int minval = 10;
	int occurs = 40;
	int ival = 50;
	if(ival1 != ival2)
		ival1 = ival2;
	else ival1 = ival2 = 0;

	if(ival < minval) {
		minval = ival;
		occurs = 1;
	}

	int ival3;
	if((ival3 = get_value()))
		std::cout << "ival = " << ival << std::endl;
	if(!ival3)
		std::cout << "ival = 0\n";

	if(ival == 0)
		ival = get_value();

	if(occurs) // stop compiler from complaining
		
	return 0;
}