Question: please write in c language !thanks so much 1. Write a C program that reads a positive integer and checks whether le O is divisible
1. Write a C program that reads a positive integer and checks whether le O is divisible by 11 using the following algorithm: . As long as the number is more than one digit, shorten it by deleting the ones digit and subtracting this digit from the resulting number. . The original number is divisible by 11 if and only if the final number is equal to zero. You should check whether the initial value entered is positive, and if not ask the user to enter another number until valid input is received. Your output should include the intermediate values computed at cach step of the algorithm followed by a statement indicating the result. Sample output 48070 4807 473 48070 is divisible by 11 2. A prime number is an integer greater than 1 whose only positive divisors are 1 and the integer itself. One method for finding all the prime numbers in the ge 2 through n is known as the Sieve of Eratosthenes. Consider the list of ran numbers from 2 through n. Here 2 is the first prime number, but the multiples of 2 (4, 6, 8,... are not, and so they are "crossed out" in the list. The first number after 2 that was not crossed out is 3, the next prime. We then cross out all higher multiples of 3 (6, 9, 12, ...) from the list. The next number not crossed out is 5, the next prime; we cross out all higher multiples of 5 (10, 15, 20, ...). We repeat this procedure until we reach the first number in the list that has not been crossed out and whose square is greater than n. Then all the numbers that remain in the list are the primes from 2 through n. Write a C program that uses this sieve method to find all the prime numbers from 2 through 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
