Question: Please use pointer and function in C language , Thank you! In mathematics, a divisor of an integer n, also called a factor of n,

 Please use pointer and function in C language, Thank you! In

Please use pointer and function in C language, Thank you!

In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible by another integer m if m is a divisor of n; this implies dividing n by m leaves no remainder. Now assume m and p are two divisors of n such that n = m xp, and let us call these two numbers "pair divisors" of n. Write a C program that receives an input number n and a query number q and checks if there is any "pair divisors" of n that their sum is equal to the query number (checks whether q == p +m). If there is any pair divisors, your code should return one of those pairs. Notes: Must write a function that computes the pair divisors of n and returns one that their sum equals q (if there is any). This function is called by the "main" function and sets the pair values it finds via pointer addresses. Use the form of this prototype: void getPairDivisor(int n, int q, int* mAddress, int* pAddress) The variables mAddress and pAddress are the addresses to values of found p and m. Your code should handle the cases where it does not find any result. Your programs should work for any positive integer values of n, q (i.e. both n >= 1 and q

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!