11-05-2011, 05:03 PM
The functions are like sub-tasks. They receive some information, do some process and provide a result. Functions are invoked through a calling program. Calling program does not need to know what the function is doing and how it is performing its task. There is a specific function-calling methodology. The calling program calls a function by giving it some information and receives the result.
We have a main ( ) in every C program. ‘main ( )’ is also a function. When we write a function, it must start with a name and surrounding braces just like with main ( ). Functions are very important in code reusing.
There are two categories of functions:
1. Functions that return a value
2. Functions that do not return a value
Suppose, we have a function that calculates the square of an integer such that function will return the square of the integer. Similarly we may have a function which displays some information on the screen so this function is not supposed to return any value to the calling program.
We have a main ( ) in every C program. ‘main ( )’ is also a function. When we write a function, it must start with a name and surrounding braces just like with main ( ). Functions are very important in code reusing.
There are two categories of functions:
1. Functions that return a value
2. Functions that do not return a value
Suppose, we have a function that calculates the square of an integer such that function will return the square of the integer. Similarly we may have a function which displays some information on the screen so this function is not supposed to return any value to the calling program.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
