checking the return value for scanf function
required for -O3 optimization