In C programming!! Function prototype and implementation for the calculateDivisors function that takes in an integer parameter, calculates the sum of its divisors, and returns that sum (as an integer value) A structure that represents what is represented on each line of output, e.g., o Linenumber o Sumofthedivisorsforthatlinenumber o Characterarraycontaining“Perfect”,“Deficient”,or“Abundant” Pointer declared within the main that will be used to point to an area of memory containing a collection of these structs Dynamically allocated memory for the number of structs necessary You will assign values to each struct via the pointer A loop that goes from X to Y, where X and Y are the numbers inputted by the user at the command line argument o Note:becausetheuserisenteringinputhere,youwillneedtocheckforreasonableness: § The value of X must be greater than or equal to 2 § The value of Y must be greater than the value of X § If either one of the above conditions are not met, you should display an error and re- prompt. The user also specifies the character used for the histogram, which is simply the sum of divisors excluding the original number. The line number column uses a column width of 4; the status of divisors is in a column of width 10.
In C
-
Function prototype and implementation for the calculateDivisors function that takes in an
integer parameter, calculates the sum of its divisors, and returns that sum (as an integer value)
-
A structure that represents what is represented on each line of output, e.g.,
o Linenumber
o Sumofthedivisorsforthatlinenumber
o Characterarraycontaining“Perfect”,“Deficient”,or“Abundant” -
Pointer declared within the main that will be used to point to an area of memory containing a collection of these structs
-
Dynamically allocated memory for the number of structs necessary
-
You will assign values to each struct via the pointer
-
A loop that goes from X to Y, where X and Y are the numbers inputted by the user at the command line
argument
o Note:becausetheuserisenteringinputhere,youwillneedtocheckforreasonableness:§ The value of X must be greater than or equal to 2
§ The value of Y must be greater than the value of X
§ If either one of the above conditions are not met, you should display an error and re-prompt.
-
The user also specifies the character used for the histogram, which is simply the sum of divisors
excluding the original number.
-
The line number column uses a column width of 4; the status of divisors is in a column of width 10.


Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









