CJCoding With Joseph
15free / daySign inCreate account

A SensorReading struct is already declared with two int fields, id and celsius.

Fill in void applyCalibration(SensorReading *r, int offset) so it adds offset to the reading's celsius field.

main is already written: it creates a reading with id 7 and celsius 20, calls applyCalibration(&reading, 5), then prints the reading.

The program must print exactly the output shown in Expected Output.

Do not print anything inside applyCalibration, and leave the id field alone.

Expected output

id=7 celsius=25

= newline. The output ends with a newline, so print one after the last line.

Hints2 available
Topics
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.