Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Converting Celsius to Kelvin

    float cel, kel;

    cout << "Converting Celsius to Kelvin
";
    cout << "------------------------------------";
    cout <<"
";
    cout << "Enter the temperature in Celsius: ";
    cin >> cel;

    kel = cel + 273.15;      //T(K) = T(°C) + 273.15 (0 °C = 273.15 K )
    cout << "The temperature of " << cel << " in Kelvin is: " << kel;
 
PREVIOUS NEXT
Tagged: #Converting #Celsius #Kelvin
ADD COMMENT
Topic
Name
4+7 =