+ 4

It's a program to find prime numbers between two limits..why here a count variable is used??anyone explain the below code

https://code.sololearn.com/cRp231DQS4rQ/?ref=app

7th Jun 2017, 4:00 PM
MUʜAMMED ÉȘʟʟYAS
MUʜAMMED ÉȘʟʟYAS - avatar
2 Answers
+ 11
It's a sort of a boolean (or a flag). You initiate it to 0 and each time you find a number that divides the number you're examining, it increases. This process repeats for every examined number. Only if the number has no divisors (except for one and itself) and therefore, the count variable is zero- the number will be prime. I hope this helps.
7th Jun 2017, 4:13 PM
dρlÏ…Ń•ÏlÏ…Ń•
dρlÏ…Ń•ÏlÏ…Ń• - avatar
+ 4
yepđŸ€—đŸ€—thnxx ...@dplusplus👏👏👏
7th Jun 2017, 4:19 PM
MUʜAMMED ÉȘʟʟYAS
MUʜAMMED ÉȘʟʟYAS - avatar