Computer Science, asked by sumit3420, 10 months ago

what are the different parts of function explain with example​

Answers

Answered by Anonymous
54

Functions are used for Placing or Storing the Code which is to be Repeated Several Times. For Example, if we need Same Code, then we must have to Write that Code Again and Again So that for Removing this Task, we uses functions.

The Functions are Some Storage Area which Contains set of Statements and the Function Executes all the Contained Statements when a Special Call is made to them. Once a Code is stored in the Function, then we can Store that Function any time and Any Time we can call that Functions.

Functions are used for performing the repetitive task or we can say the functions are those which provides us the better efficiency of a program it provides us the facility to make a functions which contains a set of instructions of the repetitive types or we need them in a program at various places Thus a functions provides us the ability to make a function which contains a code and then use them when a functions can call then it executes the statements those are contained in it.

Functions Provides us Following Features

• Reusability of Code : Means Once a Code has Developed then we can use that Code any Time.

• Remove Redundancy: Means a user doesn’t need to Write Code Again and Again.

• Decrease Complexity: Means a Large program will be Stored in the Two or More Functions. So that this will makes easy for a user to understand that Code.

There are Two Types of Functions

• Built in Functions

• User Defined functions

The Functions those are provided by C Language are refers to the Built in Functions For example. cin and cout, getch , Clrscr are the Examples of Built in Functions. So that all the functions those are provided by the C++ Language are Pre defined and Stored in the Form of header Files so that a user doesn’t need to Know how this Function has developed and a user just use that Function.

But in the other hand the Functions those are developed by the user for their Programs are known as User Defined Programs. When a user wants to make his Own Function, then he must have to follow the Following Operations.

• Function Declaration or Prototyping

• Function Defining

• Calling a Function

I hope it will help you!

Plz Follow me!

Mark as Brainlist!

Answered by aditijaink283
0

Answer:

The answer to the given question is:

a. Return Type

b. Function Name

c. Parameters

d. Function Body

Explanation:

Here are all parts of the function. -

Return Type - The data type of the value returned by the function is specified by return type. Some functions carry out the intended activities but do not return a value. The keyword void for these functions.

Function Name- The true name of the function is the function name.

Parameters - When a function is called, it passes a value to the parameter. These values ​​are called actual parameters or arguments. The parameter list indicates the type, order, and a number of function parameters. The parameter is optional. That is, a function can have no parameters.

Function body - The function body contains a series of statements that define what the function does.

#SPJ3

Similar questions