I'm having trouble finding the error in the following code:
#include <stdio.h>
#define LOOP 0
#define ENDLOOP 1
main()
{
int c, loop;
loop = LOOP;
while ((c = getchar()) loop != ENDLOOP) {
if (c == 'e'|| c == 'E') {
printf ("END LOOP\n");
loop = ENDLOOP;
}
else if (c == 'c' || c == 'C')
printf ("Cheese\n");
else
printf ("Not Cheese\n");
}
}
The terminal is giving me this error:
1-1.c: In function ‘main’:
1-1.c:8: error: syntax error before ‘loop’
1-1.c: At top level:
1-1.c:13: error: syntax error before ‘else’