summaryrefslogtreecommitdiff
path: root/5p2.cpp
blob: ce158c93d119d63f863532c26e2a381e1a74fe65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

/*
 *
 * 5.2
 *
 *
 */

int main () {

	// A block is when we need to do multiple statements for example within a loop (which only requires 1)
	// A block is also useful to contain objects in a certain scope and such.
	int i = 0;
	int j = 0;
	while(i != 100) { // Start of block
		++i;
		j = i * 2;
	} // end of block

	std::cout << i << " " << j << std::endl;
	return 0;
}