K&R C Exercise 1-15: Rewrite Temperature Conversion Using a Function
Exercise 1-15. Rewrite the temperature conversion program of Section 1.2 to use a function. Section 1.2 of K&R embeds the conversion formula directly inside main. It works — but it ties the formula to one spot in the code. This exercise asks you to extract that logic into a separate function called celsius. The payoff …