hey i have written two functions and need to pass the value given to one function into an equation that is contained in another function.
this is the first function that is given a value from user input:
and i need to use this value entered by the user to solve an equation inside of this functionCode:double getAltitude() { double a; printf("\nEnter altitude (m):"); scanf("%lf", &a); if (a > 9000) { printf("Invalid input! Altitude must be between 0 and 9000m"); return getAltitude(); } else if ( a < 0 ) { printf("Invalid input! Altitude must be between 0 and 9000m"); return getAltitude(); } return a; }
where the user input from the first function should be called in place of the variable (a) in the density equation.Code:double density() { double density, a ; density = (1.2 - 1.33*pow(10, -4)*a); return density; }
any help would be appreciated
cheers