Alternatively, add a space before %c in scanf format specifier, this will make %c ignore whitespace. eg. "scanf(" %c%f%d", &b1.name, &b1.price, &b1.pages);"
Format specifiers such as %d, %s ignore leading whitespace, whereas %c doesn't. The %c matches your newline character entered in the...