Computing : F452
Computer Science and ICT discussion, revision, exam and homework help.
-
Re: Computing : F452basically it means when there is a main set of instructions and when the subroutine is called it jumps to the subroutine set of instructions, executes them, then jumps back to the main set of instructions(Original post by john.harvey93)
Hi,
Apologies for what might seem a really dumb question - I'm learning the AS with a friend as our sixth form doesn't offer Computing.
What does it mean when a subroutine is *called* or when a recursion "calls" itself?
Cheers -
Re: Computing : F452Here, I'll show you with an example. I'll use Pascal as the language for it's fairly similar across most languages.(Original post by john.harvey93)
Hi,
Apologies for what might seem a really dumb question - I'm learning the AS with a friend as our sixth form doesn't offer Computing.
What does it mean when a subroutine is *called* or when a recursion "calls" itself?
Cheers
Code:program example; procedure example_procedure (arguments) //declaring the procedure begin <statements> example_procedure(arguments) // calling the procedure from within itself is called recursion end; //procedure is over begin // main body of code var example_integer : integer; //declaring a variable type integer example_integer = example_procedure(example_integer) //calling the procedure with argument end. //program is over
Hope this helped, I just got up and I'm writing this from an extremely laggy iPhone. If there are mistakes, someone please correct them.
-InoLast edited by Inorien; 28-05-2012 at 11:17.