Important Points related to Function 

1. What is a function?
A function is a small segment of the program(sub program) designed to perform a specific task and return a result to the main or calling program.

2. What are the different types of functions supported in “C” language?

C supports two types of functions. They are
1. Built-in / Library functions
2. User defined functions

3. What are library functions?
Some of the operations are programmed and stored in C library so that they can be called in the program. These functions are called as library functions.
Eg : printf(), sqrt(), pow()

4. What is a user defined function?
A user-defined function is a complete and independent program unit, which can be used(or invoked) by the main program or by other sub-programs.

5. Mention the need for a function
If there are a number of statements that are repeatedly needed in the same program at different locations,then a function may be used.

6. What do you mean by a calling function?
Once the function is created it can be called from the main program or from any other function. This main program or the function which calls another function is called calling function.

7. What is a called function?
The user-defined function which is called by the main program or from any other function is known as called function.

8. What does the return-type-specifier of a function identify?
It identifies the type of value, which will be sent back after the function has performed its task (eg: int, float).

9. Why is the return type void used?
The return type void is used if the function does not return any value to the calling function.

10. What is an argument?
Information or values are passed to the function through special identifiers are called arguments.

11. What are actual parameters?
The arguments (values) which are passed to the function when a function call is made are called actual parameters.


12. What are formal parameters?
The arguments which are used in the argument list of the function header to receive the values from the calling program are called formal parameters or dummy parameters.

13. Give the syntax of a function call?
A function call has the following syntax:
variable = function_name(arg1, arg2…); where arg1, arg2… are the actual parameters.


Thanks
Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: