![]() ![]() ![]() | functions/temperature.c - Et program som omregner frysepunkt og kogepunkt til Fahrenheit grader. | Lektion 5 - slide 20 : 30 Program 2 |
#include <stdio.h> double fahrenheit_temperature(double celcius_temp){ return (9.0 / 5.0) * celcius_temp + 32.0; } int main(void){ printf("Freezing point: %6.2f F.\n", fahrenheit_temperature(0.0)); printf("Boiling point: %6.2f F.\n", fahrenheit_temperature(100.0)); return 0; }