Tips for Assignment 4


Problem 2

The easiest way to do this problem is as suggested in the handout, namely print the number a digit at a time. If instead you decide to store the sequence of 1's and 0's as an integer and then print the that integer, you will get overflow when converting large numbers such as 46257. The symptom will be a strange result for this number rather than an error message. You can fix this by declaring your variables to be of type long instead of type int.


Last update:  06/08/00 11:55