Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. /******* Defining a function ********/
  2.  
  3. /*** Function with no return types ***/
  4. function_name(){
  5. // Statement to execute
  6. }
  7. // OR
  8. void functionn_name(){
  9. // Statement to execute
  10. }
  11.  
  12. /*** Function with return types ***/
  13. return_type function_name(){
  14. // Statement to execute
  15. return value;
  16. }
  17. // Example :
  18. int calculate_sum(a, b){
  19. return a + b;
  20. }
  21.  
  22.  
  23. /******* Executing a function ********/
  24. function_name();
  25. int sum = calculate_sum(2,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement