Can someone please explain me how the output comes 20 if the n value is 5 or 56 if the n value is 8 for the following program?
Thanks a lot.Code:# include < stdio .h > # include < stdlib.h > int main (int argc , char * argv []) { int a [64] , i; int n = atoi ( argv [1]); a [0] = 0; for (i = 1; i < n; i ++) { a[i] = a[i -1] + 2 * i; } printf(" %4d\n", a[n -1]);return 0; }