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

Assignment, write an essay explaining the following: 1.Storage aspects a. D...

write an essay explaining the following: 1.Storage aspects a. Disk formatting, b.Disk boot block ,c.Bad block removal, d.Compensation.

Use Decision Tree Technique to Optimize Institution’s Studen, Use Decision ...

Use Decision Tree Technique to Optimize Institution’s Student Admission Process– A Case Study

Explian, explain anatomy of digital coputer

explain anatomy of digital coputer

GNF, what does it means

what does it means

C++, whats the out put of int main(){ int n=310; funcone(n); functwo(&n); ...

whats the out put of int main(){ int n=310; funcone(n); functwo(&n); cout return 0; } void funcone(intn) n=240; } void func two(intn*) { n=120; }

Explain the functions of alu, Question 1 Write down the Booth's Multiplica...

Question 1 Write down the Booth's Multiplication Algorithm. Justify the Booth's Multiplication Algorithm Question 2 Explain the functions of ALU Question 3 Define the term ins

Outdoor patient department features - a doctor module, A Doctor Module ...

A Doctor Module Doctor has a list of the patients waiting for consultation. The doctor's module should include all the following details: Fields for common complaint

Apple''s rbv, What''s a resource based view of Apple Corporation?

What''s a resource based view of Apple Corporation?

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