Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Florian Grasshoff - Aufgabenzettel 3 - Nr.2
- #include <stdio.h>
- #include <stdlib.h>
- float celsius2kelvin(int x)
- {
- float y;
- y=x + 273.15; //Hier bitte Berechnung einfugen
- return y;
- }
- float celsius2fahrenheit(int x)
- {
- float y;
- y=x*1.8+32; //Hier bitte Berechnung einfugen
- return y;
- }
- int main()
- {
- float temp_celsius,temp_kelvin,temp_fahrenheit;
- int i;
- printf("Celsius\t\tKelvin\t\tFahrenheit\n");
- for(i=1;i<=100;i++){
- temp_celsius=i;
- temp_kelvin=celsius2kelvin(i);
- temp_fahrenheit=celsius2fahrenheit(i);
- //Ausgabe mit 3 Nachkommastellen
- printf("%9.3f\t%9.3f\t%9.3f\n",temp_celsius,temp_kelvin,temp_fahrenheit);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement