It's a program to find prime numbers between two limits..why here a count variable is used??anyone explain the below code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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