Table Of Contents
Previous Section Next Section

Program 102: Zipping Along

On most UNIX systems, this program works. On MS-DOS, it does not. Why?

  1 /********************************************
  2  * Check a couple of zip codes.             *
  3  ********************************************/
  4 #include <iostream>
  5
  6 int main()
  7 {
  8     // A couple of zip codes
  9     const int cleveland_zip   = 44101;
 10     const int pittsburgh_zip  = 15201;
 11
 12     if (cleveland_zip < pittsburgh_zip)
 13     {
 14         std::cout <<
 15             "Cleveland < Pittsburgh (Wrong)\n";
 16     }
 17     else
 18     {
 19         std::cout <<
 20             "Pittsburgh < Cleveland (Right)\n";
 21     }
 22
 23     return (0);
 24 }

(Next Hint 104. Answer 104.)

Table Of Contents
Previous Section Next Section