Skip to content

Instantly share code, notes, and snippets.

@mahata
Created September 13, 2011 05:31
Show Gist options
  • Save mahata/1213189 to your computer and use it in GitHub Desktop.
Save mahata/1213189 to your computer and use it in GitHub Desktop.
C++ Primer 3.5
#include <iostream>
int main()
{
using namespace std;
double mile;
double gallon;
cout << "Enter how many miles you have driven: ";
cin >> mile;
cout << "Enter how many gallons of gasoline you have used: ";
cin >> gallon;
cout << "Your car can run " << mile / gallon << " km per one gallon of gasoline"<< endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment