Weird behavior of Visual Studio

Revision en2, by skpro19, 2018-01-02 21:11:59

I observed a weird thing today in the Visual Studio IDE while solving the second question of Hourrank 25. This the the code.

On my local machine, the value of pre[0][0], automatically becomes 1 randomly anywhere inside the while loop. However, the weird thing is, if I initialise the value of fact[0] to 0, then everything becomes normal again. This is weird because the computation of fact has nothing to do with the value of pre[0][0].

I feel silly asking this, but what am I missing? The code which is giving wrong answer on the local machine , gives the correct answer on Ideone, and also fetches full marks after submission.

Can someone please help.

Thanks. Peace.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English skpro19 2018-01-02 21:11:59 7 Tiny change: 's the the ![ ](https://' -> 's the the [code](https://'
en1 English skpro19 2018-01-02 21:11:13 744 Initial revision (published)