Find temperature of missing days using given sum and average | Function for finding the temperature ; Store Day1 - Day2 in diff ; Remaining from s will be Day1 ; Print Day1 and Day2 ; Driver Code ; Functions
function findTemperature ( x , y , s ) { let Day1 , Day2 ; let diff = ( x - y ) * 6 ; Day2 = ( diff + s ) / 2 ; Day1 = s - Day2 ; document . write ( " " + Day1 + " " ) ; document . write ( " " + Day2 + " " ) ; } let x = 5 , y = 10 , s = 40 ; findTemperature ( x , y , s ) ;