Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /*
  2. Title: This program will use a function to find product
  3. of two numbers
  4. Author: Steven Su
  5. Date: September 21 2014
  6. Description: You will be asked from function product() to enter
  7. 2 numbers from the keyboard. The function product()
  8. will calculate and output the product and return control
  9. to main().
  10. */
  11.  
  12. // INCLUDE SECTION
  13. #include <stdio.h> // def's 4 scanf, printf, getchar, fflush, puts.
  14. #include <conio.h> // def's 4 getch
  15. #include <stdlib.h> // def's 4 system
  16.  
  17. // FUNCTION PROTOTYPES
  18. void product (void);
  19.  
  20. int main(void)
  21. {
  22. system("cls");
  23. product(); // function call
  24. system("pause");
  25. }
  26.  
  27.  
  28. // FUNCTION DEFINITIONS
  29. void product(void)
  30. {
  31. // VARIBLE DECLARATIONS
  32. float num1,num2,answer;
  33.  
  34. // EXPLAIN TO USER
  35. puts;("You will be asked from function product() to enter");
  36. puts;("2 numbers from the keyboard. The function product()");
  37. puts;("will calculate and output the product and return control");
  38. puts;("to main().");
  39. puts("");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement