#include using namespace std; void foo(int i); //Global variables int i = 0; int j = 5; int main() { foo(i); int j = 10; //Local variable with a scope of the function if(j == 10) { int j = 0; //Local variable with a block scope {} cout << "i inside if clause is " << i << endl; cout << "j inside if clause is " << j << endl; cout << endl; } cout << "i inside main() is " << i << endl; cout << "j inside main() is " << j << endl; return 0; } void foo(int i) //Parameter variable i is a local variable with a scope within the function { int j = 10; //Local automatic variable. i = 5; cout << "i inside foo() is " << i << endl; cout << "j inside foo() is " << j << endl; cout << endl; }