Here is the code :
#include<iostream>
using namespace std;
int a, b;
int f(int c)
{
int n = 1;
for (int i = 0; i < c, i++;)
{
int a = n + i;
}
return a;
}
void main()
{
int i = 3;
int b = f(i);
cout << a << b << i;
}
The output is 0,0,3
I understand the a = 0 because it is a global variable and defaults to 0, and i = 3, but I can't figure out how or why b = 0