I l@ve RuBoard |
![]() ![]() |
4.14 Answers to Chapter QuestionsAnswer 4-1: The largest number that can be stored in an int on a Unix machine is 2,147,483,647. When using an old MS-DOS compiler the limit is 32,767. The zip code 92126 is larger than 32,767, so it is mangled and the result is 26,590. This problem can be fixed by using a long int instead of just an int. The various types of integers are discussed in Chapter 5. Answer 4-2: The problem concerns the division: 1/3. The number 1 and the number 3 are both integers, so this is an integer divide. Fractions are truncated in an integer divide. The expression should be written as: answer = 1.0 / 3.0 ![]() |
I l@ve RuBoard |
![]() ![]() |