UrbanPro
true

Take BTech Tuition from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What Is the Difference Between Function And Subroutine?

Shiladitya Munshi
05/07/2017 0 0

The difference is indeed very thin and it depends on the context. In general Function is a piece of code with a name, inputs (arguments) and an output (return types). That is function should always return. Some programming languages are there which uniquely maps inputs to the corresponding outputs. But surely C is not such.  There is also a convention (but not a very strict one) that a function should not change any global variable. In C language, a function is always a realistic part of the code.

Subroutine is just a piece of any sorts of code with a definite entry and exit point. It should not return anything and a subroutine can always change global variables. These are generally used for conceptual purposes like in psudocodes.

0 Dislike
Follow 0

Please Enter a comment

Submit

Other Lessons for You

Facts about C language
C programming language was developed in 1972 by Dennis Ritchie at AT&T Bell Labs. It was developed to overcome the problems of languages such as B, BPCL. It was developed to write the Unix operating...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

Post - Fix Expression Evaluation Procedure
Algorithm: 1) Create a stack to store operands (or values). 2) Scan the given expression and do following for every scanned element. a) If the element is a number, push it into the stack. b) If the...

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

How to learn or method of learning?
Friends,Now we will see what is learning definately you may feel that is this a question. we know very well becuase we already gone through that process i.e schools & college. But again i want to focus...
S
X

Looking for BTech Tuition Classes?

The best tutors for BTech Tuition Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Take BTech Tuition with the Best Tutors

The best Tutors for BTech Tuition Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more