Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**Use C and only use ** You are going to make a program which generates a list of factors of an integer given by the

**Use C and only use **

You are going to make a program which generates a list of factors of an integer given by the user interface.

Requirements:

1. Contains a user-interface function which requests the user to enter an integer, and returns the given integer. If the given value is a character or string, the program must display an error message and prompt the user to enter an integer. You only need to test for the input of characters and integers. You do not have to worry about floats being entered. If the given number is less than or equal to 0, the program must display an error message and prompt the user to enter a positive integer.

2. Contains a print function which uses a for loop to generate a list of factors starting from 1 to the given number itself with indeces. (see the sample below)

3. Contains a function called isDivisible with the following prototype: int isDivisible(int,int);

4. The table must be formatted. (see the sample below) Columns must be right-aligned.

image text in transcribed

Please enter an integer to check its factors: 72 Index Factor 2 4 4 6 12 18 24 36 72 10 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions