What is Function? Function in C?

 Function in C:-

-A function is a block or group of statements that perform a specific task. A block of code with a unique name performing Some specific task, which can be used multiple Itimes throughout the execution.

-Using function is a good practice as it provides features of modularity a reusability. Modularity means, the large fundo program can be divided into sub program separatly and use it again & again i.e. code reusability.

In c function is divided into two types such as 

1)Predefined functions 

2)userdefined functions

-predefined or library functions! - 

-It is a predefined functions which is declared in c headerfiles.

-These function are used to performing common mathematical calculation, string manipulation etc.

-Example! printf(), scanf(), closes (), et getch(), strlenci, sqrt(x), pow (x,y) etc.

user-defined functions: -

-The function defined by the programmer as per their requirement is known as   user defined functions.

-A function is a self-contained block of code that perform a particular or specific task.

-It is subprogram that contain group of statement will be executed a particular task.

-user defined function is basically a set of statements that takes input, perform some instruction & produces output.

-once user defined function has been designed, it can use again and again i.e. code reusable.

- it can achive modularity means large program are devided into sub program have well defined specfic task.

Comments