Temperature Converter
Platform: C++
Published Sep 30, 2008
Updated Nov 15, 2008
I began learning C++ today, and this is my first snippet. It's a temperature converter.
Then you type in the temp and it gives you the conversion.
Screen:
Enjoy
// Temperature Converter
// Coded by MountainDew
#include <iostream>
using namespace std;
int main ()
{
int temp,fahrenheit,celsius;
cout << "What is the temperature? ";
cin >> temp;
fahrenheit = temp * 9 / 5 + 32;
celsius = (temp - 32) * 5 / 9;
cout << temp << " F = " << celsius << " C" << endl;
cout << temp << " C = " << fahrenheit << " F" << endl << endl;
system("pause");
}