README.md
December 4, 2022 ยท View on GitHub
Description
This just for beginners. It shows how variables can exist in different scopes
More Info
| Submitted On | |
| By | Richard Kennesson |
| Level | Beginner |
| User Rating | 3.4 (17 globes from 5 users) |
| Compatibility | C++ (general) |
| Category | Strings |
| World | C / C++ |
| Archive File |
Source Code
//this program shows that variables can exist
//in different scopes and can be called on
//a peice of code within that scope
#include <iostream.h>
void main()
{
char ch = 'A';
cout << "Tier " << ch << '\n';
{
char ch = 'B';
cout << "Tier " << ch << '\n';
{
char ch = 'C';
cout << "Tier " << ch << '\n';
}
cout << "Tier " << ch << '\n';
}
cout << "Tier " << ch << '\n';
}