1.Which of the following is true about Subroutines?

  1. A subroutine can execute another subroutine, can contain another subroutine and shared by other programs.

  2. A subroutine can execute another subroutine, cannot contain another subroutine and shared by other programs.

  3. A subroutine can execute another subroutine, can contain another subroutine and is not shared by other programs.

  4. A subroutine can execute another subroutine, cannot contain another subroutine and is not shared by other programs.


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A subroutine can execute another subroutine, can contain another subroutine, and shared by other programs. This option is incorrect because a subroutine can execute another subroutine, but it cannot contain another subroutine. Additionally, whether it is shared by other programs or not depends on the specific implementation.

Option B) A subroutine can execute another subroutine, cannot contain another subroutine, and shared by other programs. This option is incorrect because a subroutine can execute another subroutine, but it cannot contain another subroutine. Additionally, whether it is shared by other programs or not depends on the specific implementation.

Option C) A subroutine can execute another subroutine, can contain another subroutine, and is not shared by other programs. This option is incorrect because a subroutine can execute another subroutine, but it cannot contain another subroutine. Additionally, whether it is shared by other programs or not depends on the specific implementation.

Option D) A subroutine can execute another subroutine, cannot contain another subroutine, and is not shared by other programs. This option is correct because a subroutine can execute another subroutine, but it cannot contain another subroutine. Additionally, whether it is shared by other programs or not depends on the specific implementation.

The correct answer is Option D. This option is correct because it accurately describes the characteristics of subroutines.

Find more quizzes: