Functions can be called in 2 ways either with arguments or without arguments in C program. So, these functions may or may not return values to the calling function. So, the functions are divided into 4 categories listed below : -
- C function with arguments (parameters) and with return value
- C function with arguments (parameters) and without return value
- C function without arguments (parameters) and without return value
- C function without arguments (parameters) and with return value
| S.no | C function | syntax |
| 1 | with arguments and with return values | int function ( int ); // function declaration function ( a ); // function call int function( int a ) // function definition {statements; return a;} |
| 2 | with arguments and without return values | void function ( int ); // function declaration function( a ); // function call void function( int a ) // function definition {statements;} |
| 3 | without arguments and without return values | void function(); // function declaration function(); // function call void function() // function definition {statements;} |
| 4 | without arguments and with return values | int function ( ); // function declaration function ( ); // function call int function( ) // function definition {statements; return a;} |
No comments:
Post a Comment
Guys if you think something is wrong or should be edit than please do comment.