Divisors flow 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: 15 1 3 5 15 4 divisors sum of divisors: 24 Enter a positive number. Enter 0 to end: 36 1 2 3 4 6 9 12 18 36 9 divisors sum of divisors: 91 Enter a positive number. Enter 0 to end: 43 1 43 2 divisors sum of divisors: 44 Enter a positive number. Enter 0 to end: 0 Thanks and bye! Divisor counter Using what you did in part 1,to develop a function called unsigned 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, 15 The function will return 2 for 17 because 17 only has two divisors 3.Prime number Using the function you developed in part 2, write a int 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 number A 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 11 5 Prime numbers smaller than 12 Please enter a positive integer number (0 to end): 7 Factors of 7 are: 2 3 5 7 4 prime numbers smaller than 7 Please enter a positive integer number (0 to end): 0 Thanks 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

.Divisors

flow 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: 15
1 3 5 15
4 divisors
sum of divisors: 24

Enter a positive number. Enter 0 to end: 36
1 2 3 4 6 9 12 18 36
9 divisors
sum of divisors: 91

Enter a positive number. Enter 0 to end: 43
1 43
2 divisors
sum of divisors: 44
Enter a positive number. Enter 0 to end: 0
Thanks and bye!

  1. Divisor counter

Using what you did in part 1,to develop a function called
unsigned 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, 15
The function will return 2 for 17 because 17 only has two divisors

 

3.Prime number

Using the function you developed in part 2, write a
int 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 number

A 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 11

5 Prime numbers smaller than 12

Please enter a positive integer number (0 to end): 7 Factors of 7 are: 2 3 5 7

4 prime numbers smaller than 7

Please enter a positive integer number (0 to end): 0

Thanks 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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education