Subroutine , Basic Computer Science

Subroutine:  

A subroutine  is a type of subprogram, a piece of code within a larger program that performs a specific task and is relatively independent of the remaining code.  It is also called a procedure, routine or a method.  A subroutine has no value associated with its name. All outputs are defined in terms of arguments; there may be any number of outputs. 

 In most cases, a subroutine needs some information about the circumstances in which it has been called. A procedure that performs repeated or shared tasks uses different information for each call. This information consists of variables, constants, and expressions that you pass to the procedure when you call it.

  A parameter represents a value that the procedure expects you to supply when you call it. You can create a procedure with no parameters, one parameter, or more than one. The part of the procedure definition that specifies the parameters is called the parameter list. 

 An argument represents the value you supply to a procedure parameter when you call the procedure. The calling code supplies the arguments when it calls the procedure. The part of the procedure call that specifies the arguments is called the argument list. For example here is a subroutine to find the sum of three numbers    

Posted Date: 10/23/2012 3:58:31 AM | Location : United States







Related Discussions:- Subroutine , Assignment Help, Ask Question on Subroutine , Get Answer, Expert's Help, Subroutine Discussions

Write discussion on Subroutine
Your posts are moderated
Related Questions
Using Weka 3.6 (basketball or cloud data set). Using the EM clustering method, how many clusters did the algorithm decide to make? If we change from "Use Training Set" to "Percenta

Specifying Search Problems In our agent expressions, a problem to be solved is a specific task where the agent starts with the atmosphere in a given state and acts upon the env

Advantages and Disadvantages of E-Learning: Before we discuss about advantages and disadvantages of e-learning, you should know that e-learning is just another model for learn

Consistency or data in DBMS Consistency - data in DBMS(Database) is accurate in modeling real world, follows integrity constraints User may ensure transaction consistent by itsel

Assignment of computer science


Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative

Dataflow Modeling for DSP Design The necessary components in the research of application-specific computer architectures are: 1) a clearly identified set of problems that can b

Question 1 Describe the four components of light source Question 2 Briefly explain the types of textures Question 3 Explain the standard settings used to adjust th

QUESTION We wish to use the Kaiser window method to design a discrete-time filter with generalized linear phase that meets specifications of the following form: