Which of the following statements are correct for recursion?

a. Recursion is available only in the C and C++ languages.
b. Recursion is available in all programming languages.
c. Recursion is available in most modern programming languages, including C++.
d. Recursion is a preprocessor technique
e. Recursion, if used with care can be a useful programming technique.

c) and e)
Explanation: Part a) is in error, one has only to note almost any programming language designed since FORTRAN, though the student will only know the statement in a) from the text. Part b) is false, since there are some languages that do not support recursion. The text asserts “most modern languages … all functions [to be] recursive.”. This is part c). Part d) The preprocessor may provide recursion, but this writer has never seen it used. e) This statement is a direct quote from the text. Experience with C++ and other programming languages bears this out.

Computer Science & Information Technology

You might also like to view...

What method of sharing CPU time involves the OS executing an application for a particular period and according to its assigned priority?

A. cooperative multitasking B. preemptive multitasking C. voluntary multitasking D. centralized multitasking

Computer Science & Information Technology

The doInOrder and doTogether statements are control structures.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology