//this program shows that variables defined in afunction
// are hidden from other functions.
#include <iostream>
using namespace std;

void anotherFunction();		//function prototype

int main()
{
	int num = 1;	//local variable
	
	cout << "In main, num is " << num << endl;
	anotherFunction();
	cout << "Back in main, num is " << num << endl;
	return 0;
}

//*******************************************************
// definition of anotherFunction						*
// it has a local variable, num, whose initial value	*
// is displayed.										*
//*******************************************************

void anotherFunction()
{
	int num = 20;	//local variable
	
	cout << "In anotherFunction, num is " << num << endl;
}
