Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Functions Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mallardrocker




PostPosted: Tue Oct 30, 2007 8:46 am   Post subject: Functions Help

Write the function that will get three integer values as parameters and return the minimum of the three values. Write an appropriate main program to test your function.

Thats is a school question... i have no idea where to start Very Happy

please help
Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: Tue Oct 30, 2007 10:12 am   Post subject: RE:Functions Help

well a function will look something like this

[syntax="turing"]function foo():int
return 0
end funtion[syntax]

so where the code says return 0 will be where yoour lowest varible so if you have a b and c as varibles and c is lower than b and a it will be
[syntax="turing"]function foo():int
return c
end funtion[syntax]
Ultrahex




PostPosted: Tue Oct 30, 2007 10:41 am   Post subject: Re: Functions Help

There is many tutorials that would help with this sort of thing on this website [compsci.ca].

For your particular case:

If Statements:
http://compsci.ca/v3/viewtopic.php?t=14656 by Cervantes
OR
http://compsci.ca/v3/kb.php?mode=article&k=9 by Ultrahex [me]

Functions and Procedures
http://compsci.ca/v3/viewtopic.php?t=14665 by Cervantes
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: