Untitled
By: a guest | Feb 9th, 2010 | Syntax:
C++ | Size: 0.47 KB | Hits: 22 | Expires: Never
#include <iostream>
using namespace std ;
int main()
{
float gallons = 0.0 ;
float miles = 0.0 ;
float milespergallon = 0.0 ;
cout << "How many miles did you drive?" << endl ;
cin >> miles ;
cout << "How many gallons can your car take?" << endl ;
cin >> gallons ;
milespergallon = miles/gallons ;
cout << "You drove " << milespergallon << "gallons worth" << endl ;
system ("pause");
return 0;
}