# Write a C program to find statistical ERROR

Write a C program to find the statistical error like Mean Error, Percentage error, Mean percentage error and Absolute percentage error.

• Mean error
• Percentage error
• Mean Percentage error
• Absolute Percentage error

# C Code to find statistical error

```#include<stdio.h>
#include<stdlib.h>
void main()
{
int n,i;
float sum=0,a[100],b[100],me=0,pe=0,mpe=0,ampe=0,s=0;
printf("\nHOW MUCH FIND NO. OF MEAN PLEASE ENTER=>");
scanf("%d",&n);
printf("\nEnter the element number=>");
for(i=0;i<n;i++)
{
scanf("\n%f",&a[i]);
}
for(i=0;i<n;i++)
{
printf("\n%f",a[i]);
}
printf("\n");
printf("\nEnter the element number=>");
for(i=0;i<n;i++)
{
scanf("\n%f",&b[i]);
}
for(i=0;i<n;i++)
{
printf("\n%f",b[i]);
}

for(i=0;i<n;i++)
{
sum=sum+(a[i]-b[i]);
}
for(i=0;i<n;i++)
{
me=me+(sum/n);
}
printf("\nThe Mean error=>%f\n",me);
pe=(pe+me)*100;
printf("\nThe mean Percentage error=>%f\n",pe);
mpe=(mpe+pe)/n;
printf("\nThe Mean Percentage error=>%f\n",mpe);
ampe=ampe+abs(mpe);
printf("\nThe Mean Absolute Percentage error=>%f\n",ampe);
for(i=0;i<n;i++)
{
s=(s+abs(mpe))/n-1;
}
printf("\nThe navie freqeucy=>%f\n",s);
}
```