Skip to main content

Posts

Showing posts with the label Programs using functions

Functions in C

A function is a self-contained block of program statements that performs a particular task. The concept of C programming is combination of functions and the program execution will begins from the special function called main(). The scanf(), printf() main() etc.. that have been used in programs so far are all functions. They are called library functions and C provides a lot of them.In addition to built in library functions, the programmers can write their own functions and use them.These are called user defined functions. When there are multiple functions in a program , each function is given different name and a list of parameters. When ever the function is to be called, we refer the function name with suitable list of arguments. The program control will then be transferred to the function and the statements in the function will be executed. After the called function is executed, the control returns to the calling function, the place it was called from.A function can call another f