Pi approximation

Hello,
Im trying to make a program to approximate pi when a certain number of values is input by the user. The more values, the more accurate. The equation is 4 * (-1^input)/(2n-1). I always end up with some weird number as the approximation, nowhere close to pi. Is there something wrong with my for loop?