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
100 animals and their respiratory organs

WHAT DO MEAN BY ALGORITHM,HOW CAN ALGORITHM HELP TO WRITE BETTER COMPUTER PROGRAM ,WRITE AN ALGORITHM IN COMPUTER INTEREST

Types of Browsers: Line Mode Browsers : The initial browsers were line mode text browsers. These browsers were simple and used to display text line by line. They used to prov

High level languages: High level languages (converted to machine code by compiler or equivalent) are much easier to program, as well as to understand. Several high level langu

implement your own hashset

Write a C++ program that declares three integers and three strings. The program prompts the user for three characters and three integers and prints them all on one line.

Question 1 Write about Potential Risks to Information Systems Factors to be addressed for making information systems more secure Question 2 Write about the foll

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

Twisted pair cables comes in two appearance : Unshielded twisted pair cable : UTP : UTP cables is the most common types of telecommunication medium used today. Its frequency range

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome