Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pleasee help with C! And follow instructions and please please do not copy other answers! Many thanks 1. (100 pts) Write a program using linked
Pleasee help with C! And follow instructions and please please do not copy other answers! Many thanks 1. (100 pts) Write a program using linked lists to find prime numbers up to 1000 using the sieve method A prime number is a whole number greater than 1, whose only two whole-number factors are l and itself. For example, 4 is not a prime number since its factors are l 2 and 4. 7 is a prime number since its factors are l and 7. The first few prime mumbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. You can follow below steps to find the prime numbers (a) Build a linked list consisting of integers 1 to 1000. You can use the following methods discussed in the class for this step. node inserthead (node head, int a) node inserttail(node head, int a) (b) Implement a method to delete all the multiples of an integer k from the linked list. This method returns the new list. node deletenultiples(node head, int k) Use this method to delete all the multiples of 2.32 from the linked list. You need to use delete- multiples method for each number from 2 to 32 to delete the multiples of that number. (c) The remaining numbers will be prime numbers. Print the linked list to see the prime numbers The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29 and should be part of your output. Submit your program electronically using the blac system
Pleasee help with C!
And follow instructions and please please do not copy other answers!
Many thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started