fork download
  1. #include <stdio.h>
  2. int Shrink(int value);
  3. int Cube(int value);
  4. int main ()
  5. {
  6. int intValue, menuSelect,Results;
  7. intValue = 1;
  8. while (intValue > 0)
  9. {
  10. printf ("Enter a positive Integer\n: ");
  11. scanf("%d", &intValue);
  12. if (intValue > 0)
  13. {
  14. printf ("Enter 1 to calculate Shrink, 2 to Calculate Cube \n: ");
  15. scanf("%d", &menuSelect);
  16. if (menuSelect == 1)
  17. {
  18. Results = Square(intValue);
  19. printf("Square of %d is %d\n",intValue,Results);
  20. }
  21. else if (menuSelect == 2)
  22. {
  23. Results = Cube(intValue);
  24. printf("Cube of %d is %d\n",intValue,Results);
  25. }
  26. else
  27. printf("Invalid menu item, only 1 or 2 is accepted\n");
  28. }
  29. }
  30. return 0;
  31. }
  32. int Shrink(int value)
  33. {
  34. return value/value;
  35. }
  36. int Cube(int value)
  37. {
  38. return value*value*value;
  39. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
12 1 12 2 -99
compilation info
prog.c: In function ‘main’:
prog.c:18:18: warning: implicit declaration of function ‘Square’ [-Wimplicit-function-declaration]
        Results = Square(intValue);
                  ^~~~~~
/home/Lu69FE/ccCvYnZQ.o: In function `main':
prog.c:(.text.startup+0xbe): undefined reference to `Square'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty