Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <iostream>
- double getFahrenheit(int celsius);
- double getKelvin(int celsius);
- using namespace std;
- int main(int argc, char** argv) {
- char contin = 'Y';
- double celsius;
- while(toupper(contin) == 'Y') {
- cout << endl << "Enter the degree in Celsius: ";
- cin >> celsius;
- cout << endl << "The degree in Celsius " << celsius;
- cout << endl << "The degree in Kelvin: " << getKelvin(celsius);
- cout << endl << "The degree in Fahrenheit: " << getFahrenheit(celsius);
- cout << endl << endl << "Would you like to continue? (Y/N): ";
- cin >> contin;
- }
- return (EXIT_SUCCESS);
- }
- double getFahrenheit(int celsius) {
- return (celsius + 273.15);
- }
- double getKelvin(int celsius) {
- return ((celsius * 1.8) + 32);
- }
Add Comment
Please, Sign In to add comment