lab01hw-arith-soln - cin >> first;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// Programmer: Doug Hogan - Solution // Section: N/A // Program: Homework Program: C++ Arithmetic // Date: August 25, 2008 // Description: This program takes in two numbers and performs the 4 // basic arithmetic operations on them. #include <iostream> // for cin, cout, endl using namespace std; // so std:: isn't needed int main() { double first; double second; cout << "Enter a number: ";
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin &gt;&gt; first; cout &lt;&lt; &quot;Enter another number: &quot;; cin &gt;&gt; second; cout &lt;&lt; first &lt;&lt; &quot; + &quot; &lt;&lt; second &lt;&lt; &quot; = &quot; &lt;&lt; first + second &lt;&lt; endl; cout &lt;&lt; first &lt;&lt; &quot; - &quot; &lt;&lt; second &lt;&lt; &quot; = &quot; &lt;&lt; first - second &lt;&lt; endl; cout &lt;&lt; first &lt;&lt; &quot; * &quot; &lt;&lt; second &lt;&lt; &quot; = &quot; &lt;&lt; first * second &lt;&lt; endl; cout &lt;&lt; first &lt;&lt; &quot; / &quot; &lt;&lt; second &lt;&lt; &quot; = &quot; &lt;&lt; first / second &lt;&lt; endl; return 0; }...
View Full Document

This document was uploaded on 02/10/2011.

Ask a homework question - tutors are online