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 Briefly explain Registers Question 2 What are complier and interpreter? Question 3 Explain the process of installing Windows XP Question 4 Wr

The Widening Web The idea, the whole world is agog now had accidental origins. Here is how it all began. In early 1969, the U.S. Defence department financed a network fo

Do you offer application programming? Please suggest?

SOFTWARE BASICS: Software is a generic term covering the concepts, procedures and instructions which cause the computer systems to accomplish the required job, Generally, soft

Packet Switching: This is one of recent techniques of switching. Packet switching was originally developed for use by ARPA network by the Defence Department of US. According t

compare encoders and multiplers

What is CAI? Explain its pitfalls.

I NEED FLOW CHART ANT DRAWINGS OF BASIC OPERATIONS OF COMPUTER

Open Systems Interconnection (OS1): As there are many different protocols for LANs and WANs, communication between two different systems can be difficult. The International St

Technology Partnerships: Such agreements provide the consumer un-limited access to vendor's technology. Such contracts are typically multi-year in nature where the consumer pa