README.md

December 4, 2022 ยท View on GitHub

Beginning C++ 4

Description

This just for beginners. It shows how variables can exist in different scopes

More Info

Submitted On
ByRichard Kennesson
LevelBeginner
User Rating3.4 (17 globes from 5 users)
CompatibilityC++ (general)
CategoryStrings
WorldC / 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';
}