Question: In C, please - int setHousePrices(int numOfHouses); - Input Parameter - an integer referring to the number of houses for which prices will be set.
In C, please

- int setHousePrices(int numOfHouses); - Input Parameter - an integer referring to the number of houses for which prices will be set. - Dynamically allocate the memory for an array to store the house prices (integers). - Go through the dynamically allocated array and initialize the values randomly in a range 100,000 to 500,000 in increments of 10,000. - Return the pointer to the dynamically allocated array. - void printHousesInPriceRange(int* housePrices, int numOfHouses, int lowPrice, int highPrice); for those houses in the format ( %dt%dln ). - After this, print the total number of houses found in the given price range. If no houses were found, print "No houses found." house.h - Header guards - Prototypes for the functions - int setHousePrices(int numOfHouses); - void printHousesInPriceRange(int housePrices, int numOfHouses, int lowPrice, int highPrice); main.c - Include all header files - Main function to do the following: - Create an integer pointer to store starting address of the dynamically allocated array. - Take the value for numOfHouses from the user. - Call the setHousePrices() function and pass numOfHouses. The function creates a dynamic array, sets the house prices, and returns the pointer to that array. - Call the printHousesInPriceRange() function to print the houses in the range [200000,400000] - Free the dynamically allocated array and end the main function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
