Subroutine , Basic Computer Science

Assignment Help:

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    


Related Discussions:- Subroutine

Define z-transform of sequence x[n], QUESTION (a) Define z-transform o...

QUESTION (a) Define z-transform of sequence x[n]. (b) A causal LTI system has impulse response h[n], for which the z-transform is                     H(z) = (1+z -1

Project, how to set up the location (e.g. plaza, hall of fame, lecture thea...

how to set up the location (e.g. plaza, hall of fame, lecture theater or etc.) and services that will be used during the exhibition; devices needed; and finally produced a compreh

C, programm for fibonacci series

programm for fibonacci series

What is a Process and process mangemen in operating system? , A process is ...

A process is a chronological program in execution. The constituents of a process are the following: • The object program to be executed ( described the program text in UNIX) • Th

Input devices of a digital computer, Input devices of a digital computer: ...

Input devices of a digital computer: Input devices are used to read the instructions and data to be processed and output devices display the results obtained after executing t

Computer, what is the computer science

what is the computer science

Analogue computers, ANALOGUE COMPUTERS A computer is basically a proble...

ANALOGUE COMPUTERS A computer is basically a problem-solving device. In aircraft radio systems the problem to be solved is concerned with navigation, in that given certain inf

Decision table , No charges are reimbursed to the patient until the deducti...

No charges are reimbursed to the patient until the deductible has been met. Hospital visits are reimbursed at 80% and Lab visits are reimbursed at 70%. Doctor''s office visits are

C programming program, I wrote a program that adds up 5x5 matrices by colum...

I wrote a program that adds up 5x5 matrices by column and row. Now i have to use pointers to rewrite the same code how would do that

Describe the binary search algorithm, QUESTION 1 Describe the binary se...

QUESTION 1 Describe the binary search algorithm using an example of your own. QUESTION 2 (a) By showing all your workings, give a big-O estimate for f(x) = (x + 1)lo

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd