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
Problem: (a) Using appropriate examples describe what are System software and Application Software. (b) Explain four tasks of file management a user frequently performs i

Question 1 Write an assembly language program to find the highest among two numbers Question2 Draw and explain the internal architecture of 8085 briefly Question3 Explai

When purchasing a database program, you must have a clear idea of what you need it for. Ask yourself the following questions. (1) Will it perform all (he operations necessary f

What is methods For handling Deadlocks?

Code for Program to find the second highest number from a given array in Assembly Language by using NASM

Configuration of a PC: Generally, when you think of purchasing a Computer, you first try to exactly know what will be the hardware components such as processor, memory etc. of

QUESTION a) Differentiate between a dynamic and a static web site. b) Why are electronic mails (e-mails) preferred to the post office mails? How do they affect the modern of

Consider the one-time pad encryption scheme to encrypt a 1-bit message m, and assume m is chosen with uniform distribution from message space M={0,1}. Let E1 be the event "message


discuss a goal utility