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
Source and Object Programs A set of instructions in a high-level language are called “Source program”. Since high-level languages are machine independent, it is required to fir

Trap doors:  This is a way of bypassing normal authentication procedure (windows/ operating system user name  and password) to access a system. Once a system is compromised (impac

An E-Mail Account: Inbox: Inbox is the main folder in your email account. It contains all the e-mails that have arrived in your e-mail account. You can click on inbox to see t

The geometric mean is obtained by multiplying all the four numbers and taking the fourth root of the product. Let x 1 ,x 2 ,x 3  and x 4  be the given four numbers then geometric

Question 1 Write a note on modems Question 2 What are the Safe Chatting Rules Question 3 Explain three basic kinds of hypertext links Question 4 Write a no

QUESTION Consider a University system which has several sub systems: Student Registration Module Registration Time Tabling Library System Human Resource Manag

What is CAI? Explain its pitfalls.

Number data types store numeric values. They are an immutable data type, which means that changing the value of a number data type results in a newly allocated object. Number objec

hitory and genration of computer

Problem 1 Perform the following conversion a. (ABE) 16 =() 2 b. (101011) 2 =() 10 2 Explain how full adder adds three bits 3 Explain digital multiplexers