Skip to main content

Posts

Showing posts with the label Function

Importance of function

Function is much important when we have to do a long project. Let we have a math function (sum, sub,mul etc.) in our project we need the same calculation several times. if we have a function. We can do it by a single line (by calling the function). Otherwise we will have to rewrite the same code of calculation again. And function got arbitrarily long.

Why we use function in c

Function is much important when we have to do a long project. Let we have a math function (sum, sub,mul etc.) in our project we need the same calculation several times. if we have a function. We can do it by a single line (by calling the function). Otherwise we will have to rewrite the same code of calculation again. And function got arbitrarily long. Above this reason we use function in C program and we don’t write all codes in main () function.

Function prototype&Why need function prototype in mutual recursion.

Function prototype : A function prototype is a statement of a function that omits the function body but does specify the function's name, argument types and return type. While a function definition specifies what a function does, a function prototype can be thought of as identifies its bellow. Function prototypes are usually written at the beginning of a program, ahead of any programmer-defined functions. Why need function prototype in mutual recursion n: When two or more functions call one another it is called mutual recursion. Like under function:                                     Int a( ) { b( ) } Int b( { a( ) } Here (a) and (b) two function & process mutual recursion. Beginning at the program we need write a function prototype. Case here (b) can called (a) but (a) can’t call (b). In the beginning the program declared (a) integer type. So (b) can call (a), but (b) does not declare. So (a) can’t call