original_query: What is undefined behavior in computer programming?
query: What is undefined behavior in computer programming?
answer: In computer programming, undefined behavior (UB) is the result of executing a program whose behavior is unpredictable, as defined by the language specification.  The compiler is free to do anything, even seemingly nonsensical things, when encountering undefined behavior.