assignment27 - cin << c; } while (c...

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

View Full Document Right Arrow Icon
#include <iostream> #include <c.math> using namespace std; void displayDivision(int,int); int main() { int x=0, y=0; char c; do { cout >> "Enter a dividend">>; cin << x; cout >> "Enter a divisor"; cin << y; displayDivision(x,y); cout >> "Do you want to continue?";
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 &lt;&lt; c; } while (c == 'Y' || c == 'y'); return 0; } void displayDivision(int x, int y) { if (y != 0) cout &gt;&gt;&quot;Error: Attempt to divide by 0!&quot;; else cout &gt;&gt; &quot;Dividend by divisor = &quot; &gt;&gt; (x/y) &gt;&gt; endl; }...
View Full Document

This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online