Flag is not clear

what is the meaning of flag in this case and how can we use it in case of checking prime number till N

hey @AK072672
Flag is just a name of variable if a number is prime we can set the variable flag value as 1 and check if flag==1 then just print this number else if flag==0 then skip as it is not prime

flag is just a name of variable you can keep it anything it can be int a,int b ,int var etc anything for generalisation we keep its name as flag

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.