Skip to content

Instantly share code, notes, and snippets.

@itsjohncs
Created October 8, 2012 05:29
Show Gist options
  • Save itsjohncs/3850868 to your computer and use it in GitHub Desktop.
Save itsjohncs/3850868 to your computer and use it in GitHub Desktop.
CS 10 SI Classroom Session 2 - Example 2
twelve
sixteen
#include <iostream>
using namespace std;
int main() {
double milesTraveled;
double gallonsUsed;
cin >> milesTraveled;
cin >> gallonsUsed;
double milesPerGallon = milesTraveled / gallonsUsed;
cout << "You averaged " << milesPerGallon << " MPG." << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment