FUNCTION IN C

                                                               FUNCTION

Afunction is a group of statements that together perform a task.Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions.

Afunction declaration tells the compilar about a function's name, return type, and parameters.A function definition provides the actual body of the function.

The C standard library provides numerous built-in functions that your program can call.For example strcat() to concatenate two strings, memcpy()  to copy one memory location to another location, and many more functions.

Why we need functions in C

Functions are used because of following reasons –
a) To improve the readability of code.
b) Improves the reusability of the code, same function can be used in any program rather than writing the same code from scratch.
c) Debugging of the code would be easier if you use functions, as errors are easy to be traced.
d) Reduces the size of the code, duplicate set of statements are replaced by function calls
.

NOTE:

1.A C-program consists of one or more function.
2.If a program has only one function, then it must be the main() function.




                                                     THOUGHT
SUCCEEFUL PEOPLE
 are not gifted;
they just 
WORK HARD,
then succeed on
PURPOSE.


                                                      THANKYOU

Comments

Post a Comment

Popular posts from this blog

Introduction of C Language

Constant in C

Computer generation