Why we use flag?

is there any specific reason to use flag as bucket what we use something else

hi @rahulguptaamezing_875983ae6b6eec5f u can use the flag to print yes or no is flag is 2 at the end print no else print 1