In a software, flag is used as a signal. Its application is not confined to c programming; it may be used in any code, regardless of language. Its function is to regulate the program’s execution and, in some situations, to debug the program.
A flag is a set of data bits that are used to record binary values as program structural indicators. A flag is a data structure element in a computer language.