As everyone else had pointed out solution for, it better to you scanf function to read string or to reading anything at all. At least that my preference. But anyway, if you still used it make sure you flush the input stream before the second call of scanf function. The following code would help you in flushing the input buffer
void clear_buffer( void )
{
int ch;
while( ( ch = getchar() ) != '\n' && ch != EOF );
}
~ssharish