Hello Sir, As we know that program execution starts with main() function. So, How globally X=100 is declared before and acessible inside the loop also??
Related to Scope of Variables
Compiler initialize variables like if it’s x =100 then what compiler will do is it will initialize a variable having a value 100. Whereas execution starts from main function.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.