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
Types of Printers 1. Impact printers The impact printers produce the image through a mechanism of striking on the stationary. 2. Line Printer This type of printer

Question 1 What is routing? Explain the principles of routing Question 2 Explain different types of server operations in Enterprise Networking Question 3 Briefly d

What Features Should the Software Contain? Although the needs of every nursing department, hospital, pharmacy, would vary, certain common features are desirable in the software

Hi there, I''m just asking that do you do data mining assignment?

IPv6 documented in 1994 (RFC 1752) is still a collection of Draft and Proposed standards Several pre-standard implementations exist IPv6 was intended to be a pragmatic up

QUESTION Consider a University system which has several sub systems: Student Registration Module Registration Time Tabling Library System Human Resource Manag

what is member dereferencing oprator ?

solution of two degree of freedom system with matlab program???

Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides.

FUNDAMENTALS OF COMPUTERS 1. Describe the importance of video in multimedia. What are some of the tips to keep in mind while making video for the web? 2. Specify the steps t