Code:

#include <stdio.h>
#include <math.h>
void scan_b(double b[30][30] , int , int );
void print_b(double b[30][30] , int , int );
void norm_b(double b[30][30], int , int );
double std_b(double b[30][30], int , int );
double avg_b(double b[30][30], int , int );
int main()
{
int k,l;
double c[30][30];
printf("please enter the number of rows and columns\n");
scanf("%d%d" , &k, &l);
scan_b(c ,k,l);
printf("The original array is:");
print_b (c,k,l);
norm_b( c , k, l);
printf("The normalized array is:");
print_b (c,k,l);
printf ("the Standard deviation is: %f\n" ,std_b( c , k, l));
printf ("the mean value is: %f\n" ,avg_b( c , k, l));
system ("PAUSE");
return 0;
}
void scan_b(double b[30][30] , int i, int j)
{
int m,n;
printf("please enter a %d*%d array\n",i,j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
scanf("%lf" , &(b[m][n]));
}
void print_b(double b[30][30] , int i, int j)
{
int m,n;
for (m=0 ; m<i ; m++)
{
printf("\n");
for (n=0 ; n<j ; n++)
printf("%f " , b[m][n]);
}
printf("\n");
}
void norm_b(double b[30][30] , int i, int j)
{
double sum=0,sum2=0,avg, avg2;
int m,n;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=(b[m][n]);
avg=sum/(i*j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
b[m][n]=b[m][n]-avg;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum2+=pow(b[m][n],2);
avg2=sum2/(i*j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
b[m][n]=b[m][n]/sqrt(avg2);
}
double avg_b(double b[30][30], int i, int j)
{
double sum=0,avg, avg2;
int m,n;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n];
avg=sum/(i*j);
return avg;
}
double std_b(double b[30][30] , int i, int j)
{
double sum2,sum,std,avg,avg2,var;
int m,n;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n];
avg=sum/(i*j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum2+=pow(b[m][n],2);
avg2=sum2/(i*j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
var=avg2-pow(avg,2);
std=sqrt(var);
return std;
}