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
Two competing architectures were developed for improving the architecture of the central processing unit, and different processors are conventional to each one. Both had their powe

a cloth merchant A cloth showroom has announced the following seasonal discounts on purchase of items: Purchase amount Discount Mill items Handloom items 0-100 - 5% 101-200 5% 7.5%

#questionConsider the one-time pad encryption scheme to encrypt a 1-bit message m, and assume m is chosen with uniform distribution from message space M={0,1}. Let E1 be the event

1. Write an algorithm and draw a flowchart to accept the names and gross salary of 5000 employees and to generate the net pay. If the gross salary is greater than N 50,000 declare

Desk Top Publishing Program: Desktop publishing programs contain many of the features of word processing software, but .go even further in the ability to layout the format of

I want the detailed theory about the options which occur when we right click on a folder.

The divisions which make a macro are: • Declaration of the macro Code of the macro Macro termination directive The assertion of the macro is done the following way: Name Macro [par

DUNIYA KA AISA KONSA KOMPUTER HAI. JISME KEYBORD, MOUSE NAHI HAI?

Question 1 Explain the protection features of MS Access? 2 What is Query Parameter? 3 What are the steps to be taken for improving performance of Microsoft Access database? 4 W

Question 1 What do you mean by semantic networks? Explain inheritance in semantic networks Question 2 Explain Partitioned semantic networks with an example Question