#include <stdio.h>
/*function prototype*/
/*value for calculating reference resistance*/

/*protype for deriving referance resistance value*/
float CalculateReferenceResistance(float,float);

/*protoype for temperature value*/

int tempchange(int,int);


int main()
{
    /*reference resistance component*/

    float rl,l,rr,terma,constant,resistance;
    int ti,t,tr;
printf("%50s\n","Calculating Elemental Resistance #U+2620");
printf("Enter Resistance Units (Ohm/m):\n");
scanf("%f",&rl);
printf("enter wire length(m):\n");
scanf("%f",&l);
rr = CalculateReferenceResistance(rl,l);

 /*temperature component*/
 printf("Input Temp:\n");
    scanf("%d", &ti);
    printf("Input Constant:\n");
    scanf("%f", &constant);

    t= tempchange(ti,tr);
    terma= t* constant;

/*simplified original forumla by removing the brackets and grouping the terms which yieled the same results, just in an alternate form*/
    resistance= rr*terma + rr;
    printf("Calculated resistance:%f\n", resistance);


return 0;}

float CalculateReferenceResistance (float rl,float l)
{
    float rr;
    rr= rl*l;
    return rr;
}


int tempchange(int ti, int tr)
{
    int t;
    tr=20;
    t= ti - tr;
return t;
}





