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
One of the facilities that the use of macros provides is the formation of libraries, which are sets of macros which can be included in a program from a different file. The formatio

QUESTION (a) Write down the Update Step in the Dijkstra's algorithm explaining its complexity. (b) Propose a Generic Algorithm for Depth-First Search Algorithm, assuming

which computer architecture use single bus structure??????? tells the name and little bit working

Telecommunications network: "A telecommunications network, at its simplest, may be regarded as comprising a transmission network, an arrangement of transmission paths and swit

function to delete a telephone book record in c programing using struct and objects...?

Access time: Access time: This is the time required to locate and retrieve stored data from the storage unit in response to a program instruction. That is the time interval be

Optical disk storage and cd - ROM: Optical disk storage is relatively new alternative to magnetic storage. Digital data is burnt into the surface of a plastic disk coated with

write a function named "location_of_largest"that takes as its arguments the following:(1) an array of integer values

A tuple is one more series data type that is like to the list. A tuple consists of a number of values divided by commas. Not like lists, though, tuples are enclosed inside parenthe

create a flowchart showing average score for the 3 quizzes assume that there are 3 sections each having 5 students the only valid number to be entered is 1-100 for the quizzes shou