The following program takes in temperature value in Celsius and converts it to Kelvin l. This code has many errors in it. Find the errors, list them, and correct the code.
int main ()
(
double C=0;. //declare input variable
cin>>d;. //retrieve temperature to input variable
double K=c+273.15;. //convert temperature
cout <<K>> '/n';. // print out temperature
)
#include <iostream>
using namespace std;
int main()
{
double C; //declare input variable
cin >> C; //retrieve temperature to input variable
double K = C + 273; //convert temperature
cout << K << '/n'; // print out temperature
}
Comments
Leave a comment