answersLogoWhite

0


Best Answer

A subroutine is typically defined as being a function or procedure that can be invoked at any point in a program, causing the procedural execution to branch to the subroutine. This is not unlike a goto or jump statement, however subroutines also make use of the program's call stack to allow values (arguments or parameters) to be passed to the subroutine, including the address of the caller so that execution can return to the point of the call when the subroutine falls from scope. A subroutine can also (optionally) return a single value to the caller, known as the return value. Return values are temporary and will fall from scope when the expression that invoked the subroutine falls from scope. However, by assigning a subroutine to a variable, the return value can be stored in that variable and can then used in subsequent expressions. Subroutines pop their arguments from the stack and construct local variables or references from the argument values. Arguments passed by reference can therefore be used to return values through the referenced values. Values returned in this manner are known as output arguments. Subroutines that use output arguments often use the subroutine's temporary return value to indicate any errors that occurred within the subroutine, with zero indicating success (no error).

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

subroutines are used to make code appear easier to use because it isolates certain statements, which you can then invoke on demand by invoking the subroutine

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Mention the importance of subroutines in programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is a term used as a synonym for module in any programming language?

subroutines procedures functions or methods


What do mean by structural programming?

Structured programming is a programming paradigm. Prior to structured programming, code was typically written with intertwining jumps or gotos producing "spaghetti" code which is difficult to both read and maintain. Structured programming primarily added subroutines and loop control statements and was later extended by procedural programming which primarily added function calls (not to be confused with functional programming) and which also made exception handling that much easier to maintain. This then led to object-oriented programming.


Structured programming concepts in c?

Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could lead to "spaghetti code" which is both difficult to follow and to maintain.


What is modular programing mention any 2 charecteristic?

Modular programming is a design technique which separates a program into small, self-contained units or modules, each focusing upon a particular aspect of the program. Modular programming typically combines structured programming, object oriented programming and generic programming techniques.


What is a prodecural programming language?

A procedural programming language is one where programs are organized into blocks of code called variously "subroutines", "functions", or "procedures", each of which handles one particular task. The main function of the program (often actually called "main") then makes a series of calls to these procedures in order to archive its goal.

Related questions

What is a term used as a synonym for module in any programming language?

subroutines procedures functions or methods


How you can perform a multitasking in C programming language?

Multi-tasking is supported by the fork and exec subroutines in the C library.


What are methods and how do they come into play with OO programming?

Methods is the OO term for what pre-OO languages called Subroutines or Functions. They were given a new name because they have additional features that the old Subroutines and Functions lacked that make programming easier. Methods support overloading and runtime dispatching to the correct Method for the Class that the data belongs to.


What do mean by structural programming?

Structured programming is a programming paradigm. Prior to structured programming, code was typically written with intertwining jumps or gotos producing "spaghetti" code which is difficult to both read and maintain. Structured programming primarily added subroutines and loop control statements and was later extended by procedural programming which primarily added function calls (not to be confused with functional programming) and which also made exception handling that much easier to maintain. This then led to object-oriented programming.


Mention the importance of computer in land records?

The mention the inportance of coumpter in land records.


What are the Advantages of using subroutines?

Subroutines can be used repeatedly without having to be rewritten each time they are used.


Structured programming concepts in c?

Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could lead to "spaghetti code" which is both difficult to follow and to maintain.


What is the importance of programming?

Without programming, computers would be expensive doorstops. Computer hardware requires computer software. Programming, even in machine code, is essential in creating that software.


Characteristics of structured programming languages?

That basically means that structures such as "for", "while", "if", are used, as well as subroutines - as opposed to lots of "goto" statements that jump around all over the place... and make the code hard to read.


What is RTML?

RTML is a real programming language, not just a page description language (though it can be used simply as a page description language). As well as tags, it has variables, conditionals, iteration, subroutines, math operators, and so on.


What has the author J A R Blais written?

J. A. R. Blais has written: 'Program LENS' -- subject(s): Computer programming 'Program SPACE-M' -- subject(s): Data processing, Mathematical models, Photographic surveying, SPACE-M 'Mathematical subroutines' -- subject(s): Computer programming


What are Submodules also known as?

subroutines