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
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

How to crete a web page name esp.html that allows users to conduct an ESP test

SYSTEMS SOFTWARE Systems Software generally is the software which control the computers and other peripherals. Ex: MS DOS, Windows 95, Unix, NetWare and Windows NT et

I need to write a narrative n overview of the diagram and an analysis of the actors

Question 1 . Explain (a) Scatter loss                                (b) Aperture medium coupling loss Question 2 . What do you mean by Geo stationary orbit? Question

write and run the following programs using 8086 assembly language that interchange the upper and lower four bits of AL register.

The Central Processing Unit : Central Processing Unit (CPU) is the brain of the computer. The intricate electronic circuitry of the CPU performs the computer's tasks of handling d

Example of flowcharting: Example Problem statement: To find out whether a given number is even or odd. Algorithm: Step 1 Start Step 2 INPUT the number n  Step 3

The basic parts of a computers are shown in Figure.   Input devices such as a keyboard, mouse or scanner are used to enter input (data and/or instructions), directly

The internet or the World Wide Web is the most familiar and popular example. These databases hold vast amounts of information, for example, on companies. By obtaining details in t