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
what is the need of a port in a computer?

Variable - Concept of programming language: Variable: As referencing memory by its physical address is very tedious, variable names are used. A variable is a symbolic name giv

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

A Python identifier is a name used for classify a function, variable, class, module or any other object. An identifier begins with a letter A to Z or a to z or an underscore (_) fo

Create a program that uses a menu with options to enter student information (name, ID, GPA), print student information, or quit the program. Use data files and FILE pointers to sto

Computers can be used for better and more efficient management and organisation of laboratories. A computer like the human brain receives information, stores and processes it and t

what is operator and operator associatively

im student of BSCS 1st semester and I have to make project for IT fair and I dont know computer that very much so please I required your help, help me if you can. thanks

Knowledge of the Environment We must distinguish between knowledge an agent receives through it's sensors and knowledge about the world from which the input comes. Knowledge a

They are used to reduce or enlarge the content of the counters. DEC INC DEC INSTRUCTION Idea: To diminish the operator. Syntax: DEC destiny This action subtracts 1 from the destiny