+ 3

anyone help me explain why this code print "0"?

https://code.sololearn.com/cWYm9419KPEb/?ref=app

4th Feb 2018, 2:18 PM
Nguyễn NhÆ° CÆ°ÆĄng
Nguyễn NhÆ° CÆ°ÆĄng - avatar
4 Answers
+ 3
It returns zero because local variables will be unknown . global and static variables will be zero. your variable is global
17th May 2018, 9:03 AM
Sachin Rokade
Sachin Rokade - avatar
+ 1
uninitialized variables often have value 0, but not necessarily
4th Feb 2018, 2:20 PM
michal
+ 1
@michal thanks!!! one more question, when it have value 0?
4th Feb 2018, 2:26 PM
Nguyễn NhÆ° CÆ°ÆĄng
Nguyễn NhÆ° CÆ°ÆĄng - avatar