fork download
  1. #include <stdio.h>
  2. // Function prototypes
  3. int Shrink(int value);
  4. int main ()
  5. {
  6. /* variable definition: */
  7. int intValue, menuSelect,Results;
  8. intValue = 1;
  9. // While a positive number
  10. while (intValue > 0)
  11. {
  12. printf ("Enter a positive Integer\n: ");
  13. scanf("%d", &intValue);
  14. if (intValue > 0)
  15. {
  16. printf ("Enter 1 to calculate Shrink \n: ");
  17. scanf("%d", &menuSelect);
  18. if (menuSelect == 1)
  19. {
  20. // Call the Square Function
  21. Results = Square(intValue);
  22. printf("Square of %d is %d\n",intValue,Results);
  23. }
  24. }
  25. else
  26. printf("Invalid menu item, only 1 is accepted\n");
  27. }
  28. }
  29. return 0;
  30. }
  31. /* function returning the Shrink of a number */
  32. int Shrink(int value)
  33. {
  34. return value/2;
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
1
compilation info
prog.c: In function ‘main’:
prog.c:21:11: warning: implicit declaration of function ‘Square’ [-Wimplicit-function-declaration]
 Results = Square(intValue);
           ^~~~~~
prog.c: At top level:
prog.c:29:1: error: expected identifier or ‘(’ before ‘return’
 return 0;
 ^~~~~~
prog.c:30:1: error: expected identifier or ‘(’ before ‘}’ token
 }
 ^
stdout
Standard output is empty