/* Program to compute sum of elements of an arry using pointers */ /* Problem 32 */ #include #include main() { float arr[20],sum; float *ptr; int n,i; clrscr(); printf("Please enter how many numbers will you use : "); scanf("%d",&n); printf("\nNow enter the elements (separated by or ) "); printf("\n\n"); for (i = 0; i < n; i++) scanf("%f",&arr[i]); ptr = arr; sum = 0; for (i = 0; i < n; i++) sum += *ptr++; printf("\nThe sum of the elements of array using pointers is : %.2f",sum); printf("\n\nPress any key to exit..."); getch(); }