Amazon.com Widgets 2nd printing - p266 - program 13.5
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 22, 2014, 07:10:40 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Chapter Study
| | |-+ Chapter 13 - Underlying C Language Features
| | | |-+ 2nd printing - p266 - program 13.5
Pages: [1] Go Down
Print
Author Topic: 2nd printing - p266 - program 13.5 (Read 959 times)
scokar
Newbie
*
Posts: 10






on: January 31, 2011, 10:23:12 PM

Code: (Objective-C)
int gcd (int u, int v)
{
int temp;

while ( v != 0 )
{
temp = u % v;
u = v;
v = temp;
}
return  u;
}


"The function gcd is defined to take two integer arguments.  The function refers to these arguments through their formal parameter names: u and v.  after declaring the variable temp to be of type int, the program displays the values of the arguments u and v, together with the appropriate message at the terminal"

No it doesn't -- after declaring temp, the function then enters the while loop.

?

Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







Reply #1 on: February 01, 2011, 09:44:48 AM

Haha.  You're right!  I guess I took those display messages out!

Cheers,

Steve
Logged
scokar
Newbie
*
Posts: 10






Reply #2 on: February 01, 2011, 10:47:40 PM

perfect. thanks Smiley
Logged
Pages: [1] Go Up
Print
Jump to:



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.