Transcription of Answers to Selected Exercises - SJSU
{{id}} {{{paragraph}}}
Programming Languages - Principles and Practice 2nd Edition by Kenneth C. Louden Thomson Brooks/Cole 2002 Answers to Selected Exercises Copyright Kenneth C. Louden 2002 Chapter 1 (a) function numdigits(x: integer): integer; var t,n: integer; begin n := 1; t := x; while t >= 10 do begin n := n + 1; t := t div 10; end; numdigits := n; end; (c) numdigits x = if x < 10 then 1 else numdigits(x / 10) + 1 (e) function numdigits(x: Integer) return Integer is t: Integer := x; n: Integer := 1; begin while t >= 10 loop n := n + 1; t := t / 10; end loop; return n; end numdigits.
considered string types. ... The predefined operations that come with the string data types are as follows, for selected languages in the above list. Pascal: None, except for the usual operations of assignment and comparison. Lexicographic ordering is
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}