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

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 Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: What is the sum of each pair of hexadecimal integers? 6B4 + 3FE

A: Hexadecimal Number System Hexadecimal is a number system that is based on-16.  The hexadecimal numb...

Q: Random walk. A Java programmer begins walking aimlessly. At each time step, she takes one step in a ...

A: import java.util.Random; public class MyRandomWalker{  public static void main(String[] args) {   //...

Q: Create a "tank" class and use it in a program that accepts height and radius from the user and print...

A: The class tank will be created using the keyword class. The __init__ function will initialize the va...

Q: BASE SAS PROGRAMMING Question 12:- When a SAS data set is created from a spreadsheet, the spreadshee...

A: Note: As per the guidelines we can only answer one specific question at a time. Since you have not m...

Q: Will the following statement cause an error? Why or why not? string luckyNumber = 7;

A: Error: “Yes”, the given code causes an error.

Q: what is KeyChar property ?

A: “KeyChar” property: It stores the character pressed from the keyboard. The character is stored under...

Q: L. Brown, a direct marketer of women’s clothing, must determine how many telephone operators to sche...

A: Click to see the answer

Q: List the three design goals for relational databases, and explain why each is desirable.

A: Relational Database A relational database is a kind of database that shops and gives access to inter...

Q: In code, what function do you call to move the focus to a control?

A: Function used to move the focus to a control: If the programmer needs to move the focus to a control...

Q: Use Armstrong’s axioms to prove the soundness of the union rule. (Hint: Use the augmentation rule to...

A: Armstrong's Rules in RDBMS:  William W. Armstrong stated two sets of rules for implementing function...

Q: What is the difference between a pretest loop and a posttest loop?

A: Difference between a pretest loop and a posttest loop:

Q: Python Programming - File & Exception   You will create the following menu Menu Create text fil...

A: A Python program is as follows, File name: “main.py” import os while(True):     print("_______Menu__...

Q: In Visual Studio, how you can you switch your view to another form?

A: Switching form: In Visual Studio, there are possibly two different ways to switch between different ...

Q: The following truth table shows various combinations of the values true and false connected by a log...

A: Logical AND operator (&&): - Only if both expressions evaluates to true the net result is tr...

Q: COSC 1336 – Programming Fundamentals IProgram 7 – Repetition Structures and Files Python Programming...

A: Steps to execute the given program code: Create a file, “program_7.txt” and enter the given data in...

Q: A polygon is convex if it contains any line segmentsthat connects two points of the polygon. Write a...

A: Programming language is missing in the question. So we will answer this program in Java language. If...

Q: Design a class named Account that contains:■■ A private int data field named id for the account (def...

A: The required program is written in java. The following java program that prints the balance, the mon...

Q: How do you determine the number of items that are stored in a ListBox control?

A: ListBox control The ListBox control in Visual basic is a windows control that lists the number of e...

Q: what five graphical data characteristics does data visualization use to highlight and contrast data ...

A: Data Visualization: Data visualization is a process in which the data is viewed according to the v...

Q: Assume your Student ID is 432306128. Use the first four numbers for caculating: k= 5 + 2 + 8 = 15, M...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...

Q: Write the definition of a function that takes as input a char value, and returns true if the charact...

A: Purpose of the program: This program will generate a function that receives a char value as input. I...

Q: Consider the following extended relational-algebra operators. Describe how toimplement each operatio...

A: In Anti-semijoin all those tuples in r are shown that do not have a matching column in s. Anti-Semi-...

Q: Show that the following equivalences hold. Explain how you can apply themto improve the efficiency o...

A: Click to see the answer

Q: use Microsoft visual basic 0.6

A: Module VBModule    Sub Main()     Dim num, odd(50), o As Integer         Console.WriteLine("Odd  Num...

Q: Write the definition of a void function with three reference parameters of type int, double, and str...

A: Function definition: The function definition gives the genuine code that is executed by the compile...

Q: Implement the following C++ expression in assembly language, using 32-bit signedoperands:val1 = (val...

A: Given: the C++ expression :  val1 = (val2 / val3) * (val1 + val2) Solution: The implementation of t...

Q: (2010 "Flash Crash") An example of the consequences of our excessive dependance on comouters was the...

A:ʉۢ A sudden drop in the prices of securities is said to be a flash crash. It was held on May 6, 201...

Q: What are the possible digits of Binary System?

A: The Binary System comprise of two only digits. These digits are 0s and 1s only. The base of binary n...

Q: Which of the following is not a correct statement?a. A table can be modified only if it doesn’t cont...

A: UPDATE command: The UPDATE command is employed to update information present in a table. It is alw...

Q: 1.i).To represent one entity that is a specific type of another entity we use…..? a.Relationshipsb.C...

A: 1. i). The right answer to this problem is option a. Relationships Explanation: - The relationship b...

Q: Write a CFG to generate the language of all strings that have more a's than b's (not necessarily onl...

A: Click to see the answer

Q: Many transactions update a common item (e.g., the cash balance at a branch) and private items (e.g.,...

A: In DBMS, competition management is the method for handling simultaneous operations without interferi...

Q: If the elements in two arrays are related by their subscripts, the arrays are called arrays.a. assoc...

A: Array in which elements related by subscript Array subscripts are used to display or define the val...

Q: In the AddTwo program, what does the .CODE directive identify?

A: .CODE directive is used to define an area of program which contains executable instructions. The .CO...

Q: Consider a federated database system in which every local site ensures local serializability, and al...

A: Serializability Serializability of the transaction specifies a list of transactions in a schedule (...

Q: Given a set of cities, the central city is the city that has the shortesttotal distance to all other...

A: Since you are not mentioning the programming language, here we are using Java to complete the progra...

Q: A(n) __________ occurs when a loop iterates one time too many or one time too few.a. general errorb....

A: Error when a loop iterates An index value of array starts from 0 rather than 1. There is a chance o...

Q: Consider the employee database of Figure 3.19, where the primary keys areunderlined. Give an express...

A: There is an example of an Employee database is given. According to the question, we need to find out...

Q: Word processing programs, spreadsheet programs, e-mail programs, Web browsers, and game programs bel...

A: Software: The software is a set of instructions that is used to perform some specific task. The sof...

Q: Will an assembly language procedure that uses the STDCALL language specifier link to aC++ program?

A: Assembly language that uses the STDCALL language An assembly language is a low level programming la...

Q: Serendipity Booksellers has a book club that awards points to its customers based on the number of b...

A: Program: //including essential headers file#include<iostream>//using standard namespaceusing n...

Q: A program contains the following value-returning method:private int Square(int value){    return val...

A: Note: Programming language is missing in the question. So we will answer this program in Java langua...