The scanf function is easy to crash, it really takes no skill at all.  Be sure to check your embedded scan codes against the args supplied; then check them again.  Chances are extremely high that you are passing the wrong kind of pointer to receive a scanf value.
Of course, all this has absolutely nothing to do with C::B, and the help you will get here is limited.  You really should be asking in a C/C++ forum where the scanf experts live.
Ringo