fork download
  1. #include <stdio.h>
  2. int joe (int mama, int cookies);
  3.  
  4. int couch (int potato);
  5. int main(void) {
  6. int mama = 0;
  7. int cookies = 0;
  8. printf("Enter number: ");
  9. scanf("%d", &mama);
  10. joe(mama);
  11. printf("Your mom made %d cookies", cookies);
  12. return 0;
  13. }
  14. int joe (int mama) {
  15. if (mama >=10) {
  16. cookies = 12;
  17. }
  18. if (mama <10) {
  19. cookies = 18;
  20. }
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:2: error: too few arguments to function ‘joe’
  joe(mama);
  ^~~
prog.c:2:5: note: declared here
 int joe (int mama, int cookies);
     ^~~
prog.c: At top level:
prog.c:14:5: error: conflicting types for ‘joe’
 int joe (int mama) {
     ^~~
prog.c:2:5: note: previous declaration of ‘joe’ was here
 int joe (int mama, int cookies);
     ^~~
prog.c: In function ‘joe’:
prog.c:16:3: error: ‘cookies’ undeclared (first use in this function)
   cookies = 12;
   ^~~~~~~
prog.c:16:3: note: each undeclared identifier is reported only once for each function it appears in
prog.c: In function ‘main’:
prog.c:9:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &mama);
  ^~~~~~~~~~~~~~~~~~
prog.c: In function ‘joe’:
prog.c:21:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty