/* ATK I Harjoitus 1, tehtava 3 */ #include main() { /* esitellaan ohjelmassa kaytettavat muuttujat */ float celsius; float fahrenheit, kelvin; /* asetetaan muuttujille alkuarvot */ celsius = 25; /* lasketaan Fahrenheit ja Kelvin asteet */ fahrenheit = celsius * 9 / 5 + 32; kelvin = celsius + 273.15; /* tulostetaan tulokset. huomaa etta nyt kaytetaan '%f' merkintaa */ printf("%fC = %fF tai %fK\n", celsius, fahrenheit, kelvin); } /* Ohjelman tulostus: 25.000000C = 77.000000F tai 298.149994K */