In computer programming, a flag can refer to one or more bits that are used to store a binary value or a Boolean variable for signaling special code conditions, such as file empty or full queue statuses.