Divisorsflow chart using modulo operator (%) to print out all the divisors of a user entered number. Your program should prompt the user to enter a positive number or 0 to end. Using a loop variable that starts at 1, your program should print out all the divisors of the entered number plus the number of printed divisors and their sum.For example:This program identifies and displays divisors of a given number.Developed as an IPC144 project.Enter a positive number. Enter 0 to end: 151 3 5 154 divisorssum of divisors: 24Enter a positive number. Enter 0 to end: 361 2 3 4 6 9 12 18 36 9 divisorssum of divisors: 91Enter a positive number. Enter 0 to end: 431 432 divisorssum of divisors: 44Enter a positive number. Enter 0 to end: 0Thanks and bye!
1.Divisor counter
Using what you did in part 1,to develop a function calledunsigned divisorCount (unsingned num)That gets an integer number as an input parameter and returns the number of divisors of that number. For example, if you send 15 to the function, it will return 4 as 15 has 4 divisors: 1, 3, 5, 15The function will return 2 for 17 because 17 only has two divisorsPrime numberUsing the function you developed in part 2, write aint isPrime(unsigned num)That gets a number as a paremeter and returns 1 if the number is prome and returns 0 if the number is not prome.Use this function to write a code that gets a number from the user and prints all the prime numbers smaller and equal to that numberA sample run of your code should look like:Please enter a positive integer number (0 to end): 12 Primes before 12 are: 2 3 5 7 115 Prime numbers smaller than 12Please enter a positive integer number (0 to end): 7 Factors of 7 are: 2 3 5 74 prime numbers smaller than 7Please enter a positive integer number (0 to end): 0Thanks and have a good day!Hint: This question is divide to three-part each of the parts is individual and the answer for each of the part will need to link together with a flowchart and c code
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here