Answers

Question and Answer:

  Home  Basic C++ Syntax

⟩ What are the scope rules you observed in the program?taskc++ investigate the operation of scope rules in a program.// variablenamescope#include <iostream>using namespace std;int i = 111;int main(){{int i = 222;{int i = 333;cout << "i = " << i << endl;{int i = 444;cout << "i = " << i << endl;{cout << "i = " << i << endl;}}}cout << "i = " << i << endl;}cout << "i = " << i << endl;return 0;}

i want to say Global scope(int i = 111;),Local scope (int i = 333;), and function scope (int i = 222;) but now, i'm confused. I really don't understand what is this question asking me. Can somebody help me break it down

 174 views

More Questions for you: