Im trying to write a simple program about the peter piper tongue twister but I cant seem to get the else part of the program working.
Code:
#include <stdio.h>
int main (int argo, char *argv[]) {
int numberOfPeppers;
numberOfPeppers = 0;
printf ("peter piper picked a peck of pickled peppers.\n");
printf ("how many pickled peppers did peter piper pick?\n");
scanf ("%d", &numberOfPeppers);
printf ("peter picked %d peppers\n", numberOfPeppers);
if (numberOfPeppers == 0); {
printf ("none? i guess he is lazy then.");
} else {
printf ("wtf is a 'peck of pickled peppers' anyway?");
}
return 0;
}
code blocks tells me the error is on the } else { line
error: expected primary-expression before "else"
error: expected `;' before "else"
ive tried comparing it to similar codes and trying to find faults with no success.
so can someone please explain the error?
thx