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
ALU’s tasks and their suitable subcomponents: Addition and subtraction these two tasks are carried out by constructs of logic gates, such as half adders and full adders. While they

In a certain word game a player can buy vowels and consonants. The first vowel is free; each additional vowel cost $1. The first two consonants are free; each additional constant c

I would like to know how to write a program for a 8086 microprocessor in ALP to find 10''s complement of a packed BCD number.

Python Strings: Strings in Python are recognized as an adjacent set of characters in among quotation marks. Python permits for either pairs of single or double quotes. Subsets of s

Digital to analogue conversion (dac): Since many systems used on aircraft will require outputs in analogue form, it will be necessary to be able to convert the digital informat

Running on a particular treadmill you burn 3.9 calories per minute. design a program that uses a loop to display the number of calories burned after 10,15,20,25,30 minutes?

ATM = Asynchronous Transfer Mode Fast packet switching and multiplexing technology (cell-based ) Support the universe of services voice, video and data traffic Provides quality of

Binary Codes: We have seen earlier that digital computers use signals that have two distinct values and there exists a direct analogy between binary signals and binary digits.

Question 1 Explain the importance of graphics in multimedia. What are few of the tips to keep in mind while using graphics for the web? Question 2 Write a long note on co

Completeness in search - artificial intelligence: It's also importance trying to calculate the number of solutions to a problem, and the density of those solutions amongst the