Subroutine and functions, Basic Computer Science

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. 

Posted Date: 10/23/2012 3:57:36 AM | Location : United States







Related Discussions:- Subroutine and functions, Assignment Help, Ask Question on Subroutine and functions, Get Answer, Expert's Help, Subroutine and functions Discussions

Write discussion on Subroutine and functions
Your posts are moderated
Related Questions
even though most systems only distinguish among user and kernel modes, some CPUs provide multiple modes. Multiple modes could be used to provide a finer-grained security strategy.

UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. Its exactly "programming project 1 - Unix Shell and History Feature (p.157-159)" in the Si

what is the first computer in this world

Ask qu The figure below shows a rooted tree, 756_Find the height.png 1.1. Find the height/level of the tree as shown above?estion #Minimum 100 words accepted#

Medical Counter/Shop The Software for medical counter/shop should maintain: Complete customer Details  Inventory Control  Billing  Linked to Accounts  Have c

what does it means

prove that the build heap operation is O(N)

Two-tiered architecture: This approach basically introduced a database server to replace the file server. The emergence of relational database management systems and graphica

#queA register is a memory location surrounded by the CPU itself, designed to be rapidly accessed for purposes of fast data retrieval. Processors normally hold a register array, wh

Computers One of the most  important invention in the design of digital  circuits  is that  of the general- purpose "stored program" computer or device. Computers are a partic