Let’s go back to the temperature.cpp that we wrote. This time, instead of giving tempf a value of the current temperature in New York:

tempf = 83;

Let’s ask the user what the temperature is using cin!



Tell the user “Enter the temperature in Fahrenheit: “ using std::cout.

And get their input using std::cin and store it in tempf.


Compile and execute your program using the terminal.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?