I am writing a small program for amortization using pointers 

```
#include <stdio.h>
#include <string.h>

double power(double a, double b);

int main(void)
{
    int loanAmount, number_of_payments, i = 0;
    double interestRate, monthlyInterestRate, monthlyPayment;
    printf("Enter amount of loan : $ ");
    scanf(" %i",&loanAmount);
    printf("Enter Interest rate per year : ");
    scanf(" %lf",&interestRate);
    printf("Enter number of payments : ");
    scanf(" %i",&number_of_payments);

    monthlyInterestRate = ((interestRate / 100) / 12); //AKA 'r' or rate.
    monthlyPayment = (monthlyInterestRate) * (loanAmount/(1 - 1/(power((1 + 
    monthlyInterestRate), number_of_payments))));

    double interest[7] = {0}; //Arbitrarily set to 7 - assuming less payments.
    double principal[7] = {0};
    double balance[7] = {0};
    balance[0] = loanAmount;
    double *ipoint,*ppoint,*bpoint,*bpointprev;

    ipoint = &interest[0];
    ppoint = &principal[0];
    bpoint = &balance[0];
    bpointprev = bpoint;

    printf("Monthly payment should be $ %lf\n",monthlyPayment);
    printf("# \t Payment \t Principal \t Interest \t Balance \n");
    for (i = 1; i <= number_of_payments; i++) {
        ipoint += i;
        bpoint += i;
        ppoint += i;

        *ipoint = *bpointprev * monthlyInterestRate;
        *ppoint = monthlyPayment - *ipoint;
        *bpoint = *bpointprev - *ppoint;

        printf("%i \t %.2f \t %.2f \t\t %.2f \t\t %.2f\n",i,monthlyPayment,*ppoint,*ipoint,*bpoint);

        bpointprev += i; //Iterates after logic for next calculation.
    }

    return 0;
}

double power(double a, double b)
{
    double i, sum = 1;
    for (i = 0; i < b; i++) {
        sum = sum * a;
    }
    return sum;
}

```

and came across an issue where the IDE I am writing in runs the program fine:

on Cloud9 IDE:

![on Cloud9 IDE, Correct](https://i.stack.imgur.com/kX7JL.png)

but on a Unix terminal, the increment variable in my for loop jumps after what seems to be an arbitrary count:

on Unix Terminal:

![on Unix Terminal, Error](https://i.stack.imgur.com/wuPJz.png)

I am fairly certain it has something to do all of the pointer references I have whizzing around, but I don't know why it would affect the int variable i in the for-loop or why the IDE would handle the error so cleanly. Please educate!