More than Hello World

More than Hello World - Problem1inC+...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem 1 in C++ //Compute average miles per gallon #include <iostream> // No functions in this one using namespace std int main () { //variable declarations int g; int s; int e; int d; int avg; // the code cout << “How many gallons were used?” cin >> g; cout << “What is the starting mileage?” cin >> s; cout << “What is the ending mileage?” cin >> e; d=e-s; a=d/g;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 05/01/2011.

Page1 / 2

More than Hello World - Problem1inC+...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online