Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[]) {
- double celsius, kelvin;
- double diff = 273.15f;
- printf("Wpisz stopnie Celsjusza: ");
- scanf("%lf", &celsius);
- printf("\n%0.2f stopni Celsjusza\n", celsius);
- kelvin = celsius + diff;
- printf("%0.2f stopni Celsjusza = %0.2f stopni Kelvina\n", celsius, kelvin);
- printf("Wpisz stopnie Kelvina: ");
- scanf("%f", &kelvin);
- while (kelvin < 0) {
- printf("ŹLE!");
- scanf("%lf", &kelvin);
- }
- printf("\n%0.2f stopni Kelvina\n", kelvin);
- celsius = kelvin - diff;
- printf("%0.2f stopni Kelvina = %0.2f stopni Celsjusza\n", kelvin, celsius);
- system("PAUSE");
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement