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 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

"Just how are we capable to get a computer to performe intelligent tasks?" One thing to answer the question is to tell that: Logic generate a science out of many forms of re

Conditional constructs are used to integrate decision making into programs. The outcome of this decision making determines the series in which a program will execute instructions.

Writing Assignment 1: Your boss wants to know about the risks of corporate blogging and recommended policies to prevent companies from liability. Write a properly informal for

What are two types of evidence geologists use to learn about Earth''s interior.?

what is meant by deliverable in strus base applications

CONCEPT IN PROGRAMMING LANGUAGE: A Programming Language is used to design and describe a set of instructions and computations to be executed by a computer. To do programming,

write a program of 2 sum and 2 product number in C++ programming language

access,excel and ms word/

These addressing modes are: With immediate addressing, no lookup of data is essentially required. The data is located in the operands of the instruction itself, not in a different