code
#include<iostream>
using namespace std;
int &fun()
{
int x = 10;
return x;
}
int main()
{
fun() = 30;
cout << fun();
return 0;
}
output wil be 10 , tell me how and when int x = 10 is changed to static int x = 10 output will be 30 .Explain both of the cases .