First of all,
scanf("%s",code);
But then, it's not clear why scanning it as string ("%s"), why not using
gets_s
. If you want zip code, it could be
int zipCode;
scanf("%d", &zipCode);
For further progress, 1) use the debugger, 2) read the documentation:
http://www.cplusplus.com/reference/cstdio/scanf[
^].
—SA