Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
August 16, 2017, 08:26:54 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: 2nd printing - p266 - program 13.5  (Read 1661 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:  

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 ゥ 2009 classroomM.com. All rights reserved.