 <p>On compilation it is generating: </p> <pre><code>[Warning] overflow in implicit constant conversion [-Woverflow] </code></pre> <p>and that's why you are getting </p> <pre><code> -1,2,-3 </code></pre> <p>as output.<br> Note: Always use debugger and debug your program.</p>