overflow_integer_division - // integer division num3 = num1...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 // class 3 demo 2 #include <iostream> #include <cstdlib> using namespace std int main() { int num1 = 9 int num2 = 2 double num3 = 0.0 int salary = 999999999999999999 // overflow double radius = 1.00000000000000000077 // underflow num3 = num1 / num2
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // integer division num3 = num1 / double (num2) n // type casting the variable num1 and num2 is promoted cout &lt;&lt; num3 &lt;&lt; endl cout &lt;&lt; salary &lt;&lt; endl // overflow cout &lt;&lt; 1 - radius &lt;&lt; endl // underflow return 0 }// end of main...
View Full Document

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

Ask a homework question - tutors are online