Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******* Defining a function ********/
- /*** Function with no return types ***/
- function_name(){
- // Statement to execute
- }
- // OR
- void functionn_name(){
- // Statement to execute
- }
- /*** Function with return types ***/
- return_type function_name(){
- // Statement to execute
- return value;
- }
- // Example :
- int calculate_sum(a, b){
- return a + b;
- }
- /******* Executing a function ********/
- function_name();
- int sum = calculate_sum(2,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement