What was the temperature when you ran the program? That could have an effect.
Seriously though, what you are doing, in both cases, is undefined behavior. When you invoke undefined behavior, anything can happen, including your program appearing to work correctly. This doesn't mean your program is okay. A program that has undefined behavior is always wrong, even if it appears to be right.
Never use gets. And never use an unadorned "%s" in a scanf format string. Make sure you always put a limit on it:
char arr[10];
scanf("%9s",arr);
But since all you seem to want is a single char, why are you using the %s format specifier anyway? You should be using %c.
@Reddy
"Here the question is "why the program is behaving like this when the size of the array is very less"?"
I answered that question in the paragraph about undefined behavior. Re-read "anything can happen". There are no requirements on the behavior of either of those programs. I looked at the other question where you weren't satisfied with the answers, and "One That Leads" said the same thing. Why are you not satisfied with the correct answer?
"To my perception both User's answers appear to be different, can i conclude that "there is a bug in "scanf" function"?"
One that Leads said it's undefined behavior, that's what I'm referring to. No, there's not a bug in the scanf function, it does exactly what it's documentation promises. You, the programmer, must be careful to make sure your arrays have enough room for any possible amount of data that scanf might put into them. If your arrays don't have enough space, then scanf will write into memory that is not owned by your program. It's undefined behavior for it to do this, but the fact that it will do this is perfectly documented, so it's up to you to make sure it doesn't happen. If you use "%s" without a limit like "%10s", then you are allowing the user to determine whether your program will exhibit undefined behavior.
"Considering the words "scanf isn't type safe" or my "compiler" sucks?"
Neither of those things, see the above point. When I said that One that Leads said the same thing, I was referring to when he called what you're doing undefined behavior. However, those statements "scanf isn't type safe", and "your compiler sucks", both of them are true( you're using Turbo C++, right? yes, it's terrible). But neither of those points are relevant to the current situation. Even though Turbo C++ does suck, I'm still pretty sure it does scanf right. At least, nothing you have said indicates it is doing something wrong in this situation.
"So a While-loop confuses the Compiler to accept more than one character?"
I wouldn't say the compiler is confused here. Inside scanf, there is a loop that reads characters from standard input. You didn't tell it to only read one character, so it just keeps reading until it comes to a space. All scanf sees is a pointer, it has no idea what size the array is.
"When i am executing the first program and entering more than one character then it is saying "General Protection Exception"
but not in the second program why?"
How many times do I need to say this?
Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard. Undefined Behavior. Anything can happen. The behavior is not dictated by the C standard.
Get it?