Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Convert Celsius to Farenheit
- **/
- #include <cstdio>
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main()
- {
- //Enter temp in celsius
- cout << "Enter the temperature in Celsius: ";
- int celsius;
- cin >> celsius;
- //calculate conversion factor for Celsius to Fahrenheit
- int factor;
- factor= 212-32;
- //calculate conversion factor for Celsius
- int fahrenheit;
- fahrenheit= factor * celsius/100 + 32;
- //output results
- cout << "\n" << celsius << " in Fahrenheit: " << fahrenheit << "\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement