tag:blogger.com,1999:blog-8612108870928357610.post3685077559730542434..comments2024-03-27T12:47:39.371+05:30Comments on Learn C Programming from Scratch: Easy-to-Follow Tutorial for Beginners: Check Whether the Given no. is Prime or Not using C | C ProgramUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8612108870928357610.post-85164546730078749852012-11-23T01:37:31.526+05:302012-11-23T01:37:31.526+05:30Hi Yasir!!! Flag is used to indicate whether the e...Hi Yasir!!! Flag is used to indicate whether the entered number say "n" is divisible by any number between 2 to n / 2. <br />If the entered number is divisible by any number between this range then value of flag becomes one and then FOR loop breaks. Outside the FOR loop, we are checking if value of FLAG is 1 then the entered number is not Prime otherwise if FLAG is 0 then the entered number is Prime.<br />Hope this will clear things up... :)Tanmay Jhawarhttps://www.blogger.com/profile/16070311658147185012noreply@blogger.comtag:blogger.com,1999:blog-8612108870928357610.post-2141359912678541762012-11-23T00:03:07.328+05:302012-11-23T00:03:07.328+05:30why we put flag=0 after ifwhy we put flag=0 after ifyasir jamilhttps://www.blogger.com/profile/17222957202875561851noreply@blogger.com