// Program 2: QuotientRemainder.C // (c) Burt Rosenberg 1996 // This program introduces integer input and the // the integer operations of quotient and modulus. #include; void main() { // Create 4 integer objects. int divisor ; int dividend ; int quotient ; int remainder ; // Get input cout << "Enter dividend: " ; cin >> dividend ; cout << "Enter divisor: " ; cin >> divisor ; // Warning: divisor must not be 0! // Calculate and print answer quotient = dividend / divisor ; remainder = dividend % divisor ; cout << dividend<< " divided by " << divisor << " equals " << quotient << " with remainder " << remainder << endl ; }