Computer Science Canada

Functions Help

Author:  mallardrocker [ 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

Author:  Nick [ 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]

Author:  Ultrahex [ 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


: