Posts by tiagohbalves • 19 points
1 post
-
1
votes3
answers97
viewsA: Why does the first element of the vector come out as zero without having stored this value there?
In C the vectors start from 0 and end in n-1 so your loop should be for(i=8;i>0;i--) or for(i=7;i>=0;i--). In your code you are reading a memory outside because you are printing 9 elements in…