#include <stdio.h>
#include <conio.h>
void fn1(int n, float * x);
float fn2(int n, float x[]);
void fn3(int n, float * x);
int main()
{ float z[]={1,2,3,4};
int j;
for (j=0;j<4;j++)
printf(" %6.2f",z[j]);
fn1(4,z);
for (j=0;j<4;j++)
printf("\n %6.2f",z[j]);
printf("\n %6.2f",fn2(4,z));
printf("\n %6.2f",fn3(4,z));
for (j=0;j<4;j++)
printf("\n %6.2f",z[j]);
return 0;
}
/*******************************/
void fn1(int n, float * x)
{ int i;
for (i=0;i<n;i++)
*x[i]= *x[i] * *x[i];
}
/*******************************/
float fn2(int n, float x[])
{ int i, s=0;
for (i=0;i<n;i++)
s+=x[i];
return s/n;
}
/*******************************/
void fn3(int n, float *x)
{ int i, j;
float t;
for (i=1;i<n;i++)
for (j=0;j<n-1;j++)
if(x[i]>x[j]){
t=x[i];
x[i]=x[j];
x[j]=t;
}}