fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int dollarsspent, numberoftimes, average;
  6.  
  7. //variable definition
  8. dollarsspent=0;
  9. numberoftimes=0;
  10. average=0;
  11.  
  12.  
  13. do{
  14. printf(: test:%d average:%d\n", numberoftimes, average);
  15. printf ("Enter the amount spent on groceries\n");
  16. scanf("%d", &dollarsspent);
  17. average:dollarsspent/numberoftimes;
  18. }
  19.  
  20.  
  21. while (dollarsspent != 1);
  22.  
  23. return 0;
  24. }
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:14:9: error: expected expression before ‘:’ token
  printf(: test:%d    average:%d\n", numberoftimes, average);
         ^
prog.c:14:32: error: stray ‘\’ in program
  printf(: test:%d    average:%d\n", numberoftimes, average);
                                ^
prog.c:14:34: warning: missing terminating " character
  printf(: test:%d    average:%d\n", numberoftimes, average);
                                  ^
prog.c:14:34: error: missing terminating " character
  printf(: test:%d    average:%d\n", numberoftimes, average);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:18:2: error: expected ‘;’ before ‘}’ token
  }
  ^
prog.c:5:36: warning: variable ‘average’ set but not used [-Wunused-but-set-variable]
   int dollarsspent, numberoftimes, average;
                                    ^~~~~~~
prog.c:5:21: warning: variable ‘numberoftimes’ set but not used [-Wunused-but-set-variable]
   int dollarsspent, numberoftimes, average;
                     ^~~~~~~~~~~~~
stdout
Standard output is empty