fork download
  1. #include <stdio.h>
  2. // Function prototypes
  3. int Square(int value);
  4. int Shrink(int value);
  5. int divide(int divide);
  6. int main () {
  7. /* variable definition: */
  8. int intValue, menuSelect,Results;
  9. intValue = 1;
  10. int intdivide;
  11. intdivide = .5;
  12. // While a positive number
  13. while (intValue > 0)
  14. {
  15. printf ("Enter a positive Integer\n: ");
  16. scanf("%d", &intValue);
  17. if (intValue > 0)
  18. {
  19. printf ("Enter 1 to calculate Square, 2 to Calculate Shrink \n: "); scanf("%d", &menuSelect);
  20. if (menuSelect == 1)
  21. {
  22. // Call the Square Function
  23. Results = Square(intValue);
  24. printf("Square of %d is %d\n",intValue,Results);
  25. }
  26. else if (menuSelect == 2)
  27. {
  28. // Call the Shrink function
  29. Results = Shrink(intdivide);
  30. printf("Shrink of %d is %d\n",intValue,Results);
  31. } else
  32. printf("Invalid menu item, only 1 or 2 is accepted\n"); }
  33. } return 0;
  34. }
  35. /* function returning the Square of a number */
  36. int Square(int value)
  37. {
  38. return value*value;
  39. }
  40. /* function returning the Shrink of a number */
  41. int divide(int divide)
  42. {
  43. return divide*divide*divide;
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
10
1
10
2
-99
compilation info
/home/ymIVAU/ccCmOs6Y.o: In function `main':
prog.c:(.text.startup+0x9e): undefined reference to `Shrink'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty