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
Accessing Folders and Printers Accessing folders, files and printers of another computer is as easy as accessing another computer. To access folders and printers of another c

#queA register is a memory location surrounded by the CPU itself, designed to be rapidly accessed for purposes of fast data retrieval. Processors normally hold a register array, wh

create a flowchart showing average score for the 3 quizzes assume that there are 3 sections each having 5 students the only valid number to be entered is 1-100 for the quizzes shou

WHY ISN''T THE PRICE STORED ON THE BARCODE

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

Software: A computer system consists of two parts - hardware and software. The first part, computer hardware, refers to all the visible components of the computer system:  key

Breadth First Search - artificial intelligence: Given a set of operators o1, ..., on in a breadth primary search, every time a new state s is reached, an action for every  oper

QUESTION (a) How VoIP Works and how VoIP helps today's business? (b) What is a signaling protocol? Explain about SIP components and their key benefits (c) What is IPTV? L

write algorithm and draw flowchart to check whether the given number is palindrome or not

CONCEPT IN PROGRAMMING LANGUAGE: A Programming Language is used to design and describe a set of instructions and computations to be executed by a computer. To do programming,