Sum of 1000000000 natural numbers

so i wrote the code of sum of n natural numbers and for 1000000000 as an input the answer is coming out as negative i.e -243309312 how can this happen

please share your code by saving it on ide.codingblocks.com