Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
A program to convert (input) kilometers into miles.
SUBMITTED BY:
Guest
DATE:
Nov. 12, 2013, 2:54 a.m.
FORMAT:
Text only
SIZE:
802 Bytes
Raw
Download
Tweet
HITS:
1145
Go to comments
Report
// A program to convert (input) kilometers into miles.
// M. Cowan, September 10th, 2011
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
// Declare and initialize variables.
float k = 0;
// Prompt user for input (in kilometers).
cout << "Please input the number of kilometers you wish to be converted "
"into miles."
<< endl << endl;
cin >> k;
// Display # of kilometers in miles.
cout << endl
<< k << " kilometers is " << (k * 0.621371192) << " miles."
<< endl << endl;
/* Pause the system so the program window does not close until user inputs
* a key. */
system("PAUSE");
return EXIT_SUCCESS;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus