Very Interesting Question

hey i am begginer and exploring all documentation. i encounter a very interesting thing.. in this piece of code if i trying to enter a character
or very big number the program just told me that i enter number (different number that i give)
and keep running it over and over... why its happens?

If I understand this correctly, you entered a number bigger than what can fit in an unsigned long, and the program got stuck in an endless loop. This happened because you didn't test if the input operation (cin >>n in this case) succeeded. Always check if, for example, replace that line with

But why the program keeps running i if i put value 21 all is good but if i put character
or very big number the program says that i put the number 3435973836 and keeps running it without asking me for another input whats the logic?

When you input a number that is bigger than what the specific data type can hold (in this case, unsigned long), the stream buffer cin goes into a fail state. Since it's in a fail state it cannot accept anymore input until it's state has been corrected.