Thursday, 19 July 2018

Finding ERROR

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
void main()
{
clrscr();

float q,w,e,r,t,x,i,p,d;
cout<<"Want to find error in your obs.? \n Enter your obs.:- ";
cin>>q;
cin>>w;
cin>>e;
cin>>r;
cin>>t;
x=(q+w+e+r+t)/5;
i=(fabs(q-x)+fabs(w-x)+fabs(e-x)+fabs(r-x)+fabs(t-x))/5;
d=i/x;
p=d*100;
cout<<"\n The Mean is: "<<x;
cout<<"\n The error(delta x) is: "<<i;
cout<<"\n The relative error is: "<<d;
cout<<"\n The percentage error is: "<<p;

getch();
}


===========================================================================


                                OUTPUT


No comments:

Post a Comment