I have a doubt why it happens that different compilers give different outputs to a same C program.If there is an standard C then why these famous compiler dont use that completely.
the difference in output is caused by 16-bit , 32-bit compilers so what are all those issues which makes the difference.
I have a doubt why it happens that different compilers give different outputs to
Share
The language standard leaves several degrees of freedom to the implementations.
Firstly, even if the program is implemented correctly, its behavior might depend on implementation-defined language features. For example, different implementations can have different ranges for basic integer types.
Secondly, the program might simply be broken. A broken program in this context is a program that relies on behavior that is either undefined or unspecified by the language. This program will appear to “work” in some way, but its actual behavior will depend on unpredictable factors and, therefore, will be inconsistent.
Practice show that in many (if not most) cases when people complain about inconsistently behaving C programs, they are actually failing to realize that they are dealing with a broken program.