Why you use flag in programming?

1 answer

Answer

1222713

2026-07-07 08:56

+ Follow

We can use flag for many reasons depending upon ur logic but normally people use flag to check which control flow led to this o/p...hmmm to make it more clear EX : if(i%2==0) flag = 1 ; else flag = 0 ; ... ... ... if(flag) print "the number is even" Like this u can use to flag to de-bug ur code or to check the control flow

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.