[Solved] How to pass variables onto another function? [closed]


Just call the function by passing the parameters a, b, and c. Syntax:

retval = function_name(parameter1,parameter2,parameter3); //pass parameters as required

Like this:

int main(void)
{
    float a, b, c;
    double d;

    printf("Enter the values of 'a','b' and 'c': ");
    if (scanf("%f %f %f",&a,&b,&c) == 3)
    {
        d = my_function(a, b, c);
        printf("Result: %f\n", d);
    }
    else
        printf("Oops: I didn't understand what you typed\n");      
}

1

solved How to pass variables onto another function? [closed]