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 (a) A dairy wants to determine the quantity of butter it should produce to meet the demand. Past records have shown the following demand pattern:

The Internet is replete with great success stories and sad failures. While it is always nice to hear about the successes, more can probably be learned from the failures. In this ca

Environments We have seen that intelligent agents might take into account certain information when   choosing   a   rational   action, by  including information from its sensor

Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative

Artificial Intelligence research: Artificial Intelligence research may be describe  in terms of how the following question has been answered: "How are we going to get a comp

Software Computer cannot be used without a software in it. It is the software which gives instructions to the hardware of the computer so as to work all devices in tande

The operating system is the layer among the hardware and the programs you run. It provides programs a standard interface to the hardware; or else every program would need to includ

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

Question 1 What do you mean by semantic networks? Explain inheritance in semantic networks Question 2 Explain Partitioned semantic networks with an example Question

explain the working of gaided media ?