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
You are an engineer involved in the development of a financial system. During installation, you discover that this system will make a significant number of people redundant. The pe

create a flowchart showing average score for the 3 quizzes assume that there are 3 sections each having 5 students the only valid number to be entered is 1-100 for the quizzes shou

Question 1 What is a desktop? Explain the Windows XP desktop? 2 How does a flash drive work? 3 Write the procedure for creating Macro 4 Explain the process of applyin

1. What actions need to be taken when a program terminates or a process is killed? What if that process destruction is not the consequence of normal termination, but rather is the


What constitutes ERP? ERP typically comprises a client server architecture, fourth generation language, RDBMS and graphical user interface in an open systems environment. It

What is an encoder? Draw the logic circuit of Decimal to BCD encoder and explain its working.?

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

QUESTION (a) Describe what is meant by Clock Skew and Clock Drift among clocks in a distributed system. (b) A clock is reading 08:25:46.0 (hr:min:sec) when it is discovered

Finding someone who doesn''t use some aspect of Microsoft Office on a daily basis is difficult. Whether it is Outlook for email,Word for creating and editing documents,or Excel f