Subroutine and functions, Basic Computer Science

Assignment Help:

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. 


Related Discussions:- Subroutine and functions

What isit, what can you do and what and how who can becbgbfbvuidfgvbkjfdhvb...

what can you do and what and how who can becbgbfbvuidfgvbkjfdhvb98dshrnfjkbhqdbnfiubnfdjbhdfiubndfubhfdbhfdiubhdfuibhyfdubhdfbhfbhdf8u

Define the elements of contlor unit , The three main elements of the con...

The three main elements of the control unit are: 1. Decoder this is used to decode the instructions that create a program when they are being processed, and to establish in what ac

Need a help, i am currently studying my computer science engineering 2nd yr...

i am currently studying my computer science engineering 2nd yr. i am unable to select what specification should i take please help me

Defining conditional operator, Problem 1 What is conditional operator? ...

Problem 1 What is conditional operator? Using conditional operator find a smallest number between two numbers Defining conditional operator Using it to find smallest n

Write a program to swap two names between two variables, QUESTION (a) W...

QUESTION (a) Write a program to swap two names between two variables for examples: N1 = "Mary Anne" N2 = "Queen Mary". The program should make use of an appropriate Fu

What are the various skills needed for broadcasting and film, Question 1 W...

Question 1 What are the various skills needed for broadcasting and film? Question 2 What is a 2 dimensional animations and 3 dimensional animations? Question 3 Different

Application software, Application Software:   Application software is ...

Application Software:   Application software is designed and developed to accomplish one or more specific task or solve a particular problem.    Application software may be

Analyze the complexity of dijkstra''s algorithm, QUESTION (a) Given the...

QUESTION (a) Given the graph as shown in figure, apply Lagrangian technique to complete the table assuming μ=1 and T=14                        Path P

Eeprom, Ask queswhat is the advanages of eeprom?

Ask queswhat is the advanages of eeprom?

What is the structure of a global.asax file in asp.net, Question (a) De...

Question (a) Describe the following built-in functions and illustrate each using simple examples. Specify every possible parameters where required Replace() StrComp()

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd