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
QUESTION (a) Distinguish between passive and active attacks. (b) Give two reasons why it is important to organise security awareness programs for users. (c) Explain how s

what is the need of a port in a computer?

different types of software interfaces which falls in different categories


COMPONENTS OF A DIGITAL COMPUTER: A digital computer is an electronic device that receives data, performs arithmetic and logical operations and produces results according to a

classify computer system according to capacity. how they are different from computer according to the classification of technology.provide the comparative study also.

Question 1 Write an assembly language program to find the highest among two numbers Question2 Draw and explain the internal architecture of 8085 briefly Question3 Explai

what is the goals of enterprise collaboration system?

find the regular expression of(a/?)(a/b)?

Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop