/* C++ Programming, Program (b), Exercise 3, Sheet 4  */

/* Author: Rob Miller and William Knottenbelt
   Program last changed: 30th September 2023    */

#include <iostream>
using namespace std;

int main() 
{
	int count = 1;
	while (count <= 5)
	{
		int count = 1;
		cout << count << "\n";
		count++;
	}	
	return 0;
}

/* This program never finishes. The output is:

1
1
1
1
1
1
1
.
.
.
(etc.)

This is because the condition "(count <= 5)" in the head of the "while" loop
is never satisfied. The "count++" inside the loop refers to a different variable
which only exists inside the scope of the inner { } braces.

*/ 

