fork download
  1. #include <stdio.h>
  2.  
  3. int product (int, int);//function declaration
  4. int main (void)
  5. {
  6. int total;
  7. printf ("\n\n function : a simple structure of function :\n");
  8. printf ("——————————————————\n");
  9. total = product (5,6); //function call
  10. printf ("The product is : %d\n" , total);
  11. return 0;
  12. }
  13.  
  14. int product (int a , int b) //function definition
  15. {
  16.  
  17. int s;
  18. s=a*b;
  19. return s; //function returning a value
  20.  
  21. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout

 function : a simple structure of function :
——————————————————
The product is : 30