Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // provide access to library
- // for console input and output
- #include <iostream>
- // define a scope so as not to
- // repeatedly type std::cin etc
- using namespace std;
- // the initial code function
- // used upon execution
- int main()
- {
- // declare decimal integers
- // for Celsius and Fahrenheit
- float c, f;
- // take user input from
- // console to variable
- cin >> c;
- // calculate the conversion
- f = c * 1.8 + 32;
- // print converted temperature
- cout << f;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement