Program with multiple local variables called i. - C++ Function

C++ examples for Function:Function Creation

Description

Program with multiple local variables called i.

Demo Code

#include <iostream>
using namespace std;
int main()//from   ww w  . ja  v  a  2 s  . c  om
{
   int i;                  
   i = 10;
   {
      int i;               
      i = 20;              
      cout << i << " " << i  << "\n";
      {
         int i;     
         i = 30;    
         cout << i << " " << i << " " << i << "\n";       
      }                 
   }
   cout << i << " " << i << " " << i << "\n";         
   return 0;
} 

Result


Related Tutorials