Subroutine and functions, Basic Computer Science

Assignment Help:

Subroutine and Functions:

 In a program, it is often necessary to repeat a statement or group of statements at several points to accomplish a particular task. Repeating the same statement in a program each time makes a program lengthy and reduces readability. These problems could be sorted out if the necessary statements could be written once and then referred to each time they are needed. This is the purpose of a subprogram. Basically there are two different types of subprograms, called functions and subroutines.  Making subprograms allows tackling small pieces of a problem individually. 

Once each piece is working correctly then the pieces are integrated together to create the complete solution of the problem. To implement functions and subroutines, we require writing the main program that references all of the subprograms in the desired order and also writing the subprograms. This can  be done in any order that is convenient. 


Related Discussions:- Subroutine and functions

Printer output, Printer output : Consider what is required here. ...

Printer output : Consider what is required here. Do you just require management information on the one hand or camera copy for reprographic purposes? Inkjet Very quiet. C

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

Algorithm writing, algorithm to simulate railway reservation process

algorithm to simulate railway reservation process

What is .net framework, Qestion 1 What is .Net Framework? Qestion 2 W...

Qestion 1 What is .Net Framework? Qestion 2 Write short notes on constructors and destructors Qestion 3 Explain boxing and unboxing with examples Qestion 4 What is

Python Strings and Python Lists, Python Strings: Strings in Python are rec...

Python Strings: Strings in Python are recognized as an adjacent set of characters in among quotation marks. Python permits for either pairs of single or double quotes. Subsets of s

Language of digital computers, Language of Digital Computers: Digital ...

Language of Digital Computers: Digital computers are electronic devices which operate on two valued logic (On and OFF). The ability of a transistor to act as a switch is the k

Define segments in assembly process?, The architecture of the x86 processor...

The architecture of the x86 processors forces with the use of memory segments to direct the information, the size of these segments is of 64kb. The cause of being of these segments

Working of web browser, Working of web Browser:   Internet is character...

Working of web Browser:   Internet is characterized by the Client Server Computing that consists of three basic components: The Web client which may be the web browser;

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