Question: C PROGRAM need exact output A12 - WAP to print all primes using Sieve of Eratosthenes method Description: In mathematics, the sieve of Eratosthenes, one

C PROGRAM need exact output

A12 - WAP to print all primes using Sieve of Eratosthenes method

Description:

In mathematics, the sieve of Eratosthenes, one of a number of prime number sieves, is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e., not prime) the multiples of each prime, starting with the multiples of 2.

The sieve of Eratosthenes is one of the most efficient ways to find all of the smaller primes. It is named after Eratosthenes of Cyrene, a Greek mathematician.

Pr-requisites:-

Loops

Operators

Arrays

Objective: -

To understand the concept of if-else constructs

Arrays

Inputs: -

A positive integer 'N'.

Sample execution: - Test Case 1: A positive number user@emertxe] ./prime_series Enter the value of 'n' : 20 The primes less than or equal to 20 are : 2, 3, 5, 7, 11, 13, 17, 19 Test Case 2 :

Enter the value of 'n' : -20 Please enter a positive number which is > 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!