Define shaping function
# include & ltstdio.h & gt

# Definition number 100

int fun 1(int a[],int n);

void main()

{

int a[N];

long int sum = 0;

int i,n;

Printf ("Enter integer n:");

scanf("%d ",& ampn);

Printf ("input array a: \ n");

for(I = 0; I & ltn;; i++)

scanf("%d ",& ampa[I]);

sum=fun 1(a,n);

Printf ("sum of squares of array elements is: %ld\n", sum);

}

int fun 1(int a[],int n)

{

long int sum = 0;

int I;

for(I = 0; I & ltn;; i++)

{

sum+= a[I]* a[I];

}

Returns the sum;

}

Results:

Enter the integer n:5

Input array a:

1 2 3 4 5

The sum of squares of array elements is: 55.

Press any key to continue.