==, not =
The scanf call is wrong as well, it's missing an &
With extra warnings, all those problems are at least hinted at.
Code:
$ gcc -W -Wall -ansi -pedantic -O2 foo.c
foo.c: In function `main':
foo.c:7: warning: format argument is not a pointer (arg 2)
// That's the missing &
foo.c:8: warning: suggest parentheses around assignment used as truth value
// That hints that = should be ==
foo.c:18: warning: control reaches end of non-void function
// you forgot the return 0;
foo.c:5: warning: 'a' might be used uninitialized in this function