Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
539 B
0
Indexable
Never
#include<iostream>
#include<math.h>
#include <iomanip>


using namespace std;

float err(float tv , float av)
{
    float a = tv-av;
    if(a<0)
    {
        a=a*-1;
    }
    return a;
}
float er(float ea, float tv)
{
    float a = ea/tv;
    return a;
}
float epp(float er)
{
    float a = er*100;
    return a ;
}


int main()
{
cout<<"Enter the true value and approximate value : ";
float a ,b;
cin>>a>>b;

float ab=err(a,b);
float eb=er(ab,a);
 float ep = epp(ab);
cout << setprecision(6);
cout<<ab<<"\n"<<eb<<"\n"<<ep;


return 0;
}
Leave a Comment