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
QUESTION 1 What are search engines? QUESTION 2 Write short notes on the inverted file. QUESTION 3 Write short notes on: (i) Derivative indexing (also known a

Question 1 Describe the following- Binary Number System b. Octal Number System Hexadecimal Number System   Question 2 Describe the Canonical Logical Forms-

I am using block matching algorithm to get the motion vectors, now, how can I get the depth map/depth value from the motion vectors?

4. Union City Al has decided to upgrade their tornado warning system. The city leaders have identified six potential locations for erecting a warning siren tower. They want to e

COMPONENTS OF A DIGITAL COMPUTER: A digital computer is an electronic device that receives data, performs arithmetic and logical operations and produces results according to a

how to measure marginal utility.?

types of computer on the basis of shape, size & resources

Question 1: (a) Initially, human information processing was believed to occur in 4 distinct stages. State and describe each of those stages. (b) What are the 3 types of

Digital computer: In the digital computer there are basically two types of input, namely Instructions, and Data from the various radio and non-radio sensors, which will be refe

explian set associte mapping