cin >> test[i];
When i run this code in DevC++ , and I input 10 ... 5 times, the total should be 50 but somehow in DEVC++ it will add extra 1 to the output so cout<<total is 51 instead. And if i copy this exact code to another IDE Embarcadero C++, with same input 10 ... 5 times, the output is 66
1) This issue is fixed when i initialize total=0 but I am curious why it worked in my lecturer's computer ( its recorded lecture and she did not initialize total=0 and she got the correct output which is 50.
2) Why is it different output in different IDEs?