Home › Forums › C Programming › calculate and display mpg in C program › Re: Re: calculate and display mpg in C program
December 21, 2008 at 10:57 pm
#3495
GWILouisaxwzkla
Participant
The average is calculated in the line:
1 2 3 | <br /> printf ( "The miles/gallon for this tank was : %f n" , miles / gallons );<br /> |
the compiler sets up a hidden temporary variable to hold the result of ( miles/gallons ) and then sends this result to the printf () function to print it……..