🔒 Closed Paexplain naman sir ng flow mga sir. Thank you

Status
Not open for further replies.

Kiss21

Eternal Poster
Sir pahelp naman po kun ani po uung mga function at flow nito sir. Salamat ng maramu sir. C++ po yan.
 

Attachments

  • 40FAFE15-5521-4D62-A589-7C7D09D8B7DF.webp
    40FAFE15-5521-4D62-A589-7C7D09D8B7DF.webp
    65 KB · Views: 58
Seriously? The comment lines on it are self explanatory.

1st loop initializes the array of bolean variables into the value "true" because at this point most likely they contain garbage values which is important for the next step.

2nd loop is where the Sieve mathematical algorithm happens. Just refer to the link the below for "
The Sieve of Eratosthenes" mathematical formula because that should be another topic entirely.
You do not have permission to view the full content of this post. Log in or register now.

3rd loop is there to count how many prime numbers there are by counting how many elements in the array of boolean "flags" which hold the value "true".

4th loop is just there to display all the prime numbers within the limit.
 
Seriously? The comment lines on it are self explanatory.

1st loop initializes the array of bolean variables into the value "true" because at this point most likely they contain garbage values which is important for the next step.

2nd loop is where the Sieve mathematical algorithm happens. Just refer to the link the below for "
The Sieve of Eratosthenes" mathematical formula because that should be another topic entirely.
You do not have permission to view the full content of this post. Log in or register now.

3rd loop is there to count how many prime numbers there are by counting how many elements in the array of boolean "flags" which hold the value "true".

4th loop is just there to display all the prime numbers within the limit.
Thank you soo much sir. Big help
 
Seriously? The comment lines on it are self explanatory.

1st loop initializes the array of bolean variables into the value "true" because at this point most likely they contain garbage values which is important for the next step.

2nd loop is where the Sieve mathematical algorithm happens. Just refer to the link the below for "
The Sieve of Eratosthenes" mathematical formula because that should be another topic entirely.
You do not have permission to view the full content of this post. Log in or register now.

3rd loop is there to count how many prime numbers there are by counting how many elements in the array of boolean "flags" which hold the value "true".

4th loop is just there to display all the prime numbers within the limit.
sir ano po yung purpose ng flags sir?
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 472
    Views
  • 4
    Participants
Last reply from:
homer_simpson

Online now

Members online
423
Guests online
1,701
Total visitors
2,124

Forum statistics

Threads
2,275,507
Posts
28,963,744
Members
1,232,820
Latest member
bababozooo67
Back
Top