[solved] Shouldn't there be a garbage value?
As far as I know if variable is not initialised then it should carry a garbage value then why in this question it is 0? Am I lacking some knowledge or there is something wrong with the question🤔🤔 https://www.sololearn.com/post/177828/?ref=app
Here is the sample code It says that there should be a garbage value https://code.sololearn.com/c6pqJK7rdAf0/?ref=app
If at least one element was given with an initialization, all the others should be set to zero. But since there's no initialization, afaik, it should be garbage values.
Avinesh But in the question it says "int a;" without the initialization and in local scope ( probably ). In your case you're indeed correct, but in this case the answer is undefined, therefore 0 is incorrect.
I suggest that you report the question.