in 1st 10/10 will be 1
after that i will be 11
in 2nd 11/11 is 1 thats why o/p is 1
in 3rd11/12 is 0.91 ant u have declared it as integer type thats why 0 is o/p
in 4th 11/10 is always 1 if it is declared as int type
1. Defined - every compiler does the same thing.
Eg. that && and || are short-circuited.
2. Implementation defined - compilers must document what they do
Eg. what right-shift >> does on signed negative integers.
Some implementations shift in zero, others shift in the sign bit. Both are correct, yet can cause problems for your code.
3. Unspecified - like implementation-defined, but undocumented.
Eg. the order of evaluation of sub-expressions.
4. Undefined - absolutely anything can happen.
You may get the answer you expect, you may get an unexplainable answer, you may get a crash in your program.
You may even get a crash (or worse) in your OS.
There is no point in even trying to understand what your compiler does, because whatever it does, it doesn't have to be consistent about it.
And everyone elses compiler is going to be different anyway.
Code which relies only on case 1 is good code.
Case 2 is OK, so long as it's well documented, but it would be much better avoided if at all possible.
Code which relies on 3 or 4 is on very shaky ground, and is best avoided.