int sum = 0, i; for (i = 0; i < Num; i++) { sum += PA[i]; } PA[0] = sum; return PA; }
intmain() { int *PArray = NULL; int Total = 0, i = 0; printf("enter the number of elements in arrays:\n"); scanf("%d", &Total); PArray = (int *)malloc(Total * sizeof(int)); printf("give %d element assignment:\n", Total); for (i = 0; i < Total; i++) { scanf("%d", &PArray[i]); } PArray = Calc(PArray, Total); printf("Sum=%d\n", *PArray); free(PArray); return0; }