What is the difference between a function and a subroutine?

前端 未结 11 1562
攒了一身酷
攒了一身酷 2021-01-30 06:32

What is the difference between a function and a subroutine? I was told that the difference between a function and a subroutine is as follows:

A function takes parameters

11条回答
  •  不思量自难忘°
    2021-01-30 07:28

    If we talk in C, C++, Java and other related high level language:

    a. A subroutine is a logical construct used in writing Algorithms (or flowcharts) to designate processing functionality in one place. The subroutine provides some output based on input where the processing may remain unchanged.

    b. A function is a realization of the Subroutine concept in the programming language

提交回复
热议问题