Question: Write a program using C in Microsoft Visual Studios that will create an integer array with 100 elements initialized to -99. Prompt the user to
Write a program using C in Microsoft Visual Studios that will create an integer array with 100 elements initialized to -99. Prompt the user to enter the number of integers to print on each line keep it less than 10 numbers per line. Call a user function to print the array pass the user function the array, array size and the number of integers to print on each line. Next the main function will then fill the array with random integers between 10 and 60 inclusive. Prompt the user to enter the number of integers to print on each line pick a different number than before. Call a user function to print the array pass the user function the array, array size and the number of integers to print on each line.
Then add an additional function to the first program to do a bubble sort in descending or ascending order. The main should prompt the user to pick which sort to do entering a char variable ascending (char variable u or U for an ascending sort) or descending (char variable d or D for descending sort). Then call the user function. The user function will be passed the array, the array size and a char variable u or U for an ascending sort or a d or D for descending sort. Use a switch statement in the user function to decide which sort to execute. Descending order i.e. largest number in element zero and smallest in last element.
Then create another additional function to the first program to search the array for duplicates and replace each duplicate with zero every duplicate number is replaced with zero. Next the main function will prompt the user to enter the number of integers to print on each line pick a different number than before. Call a user function to print the array pass the user function the array, array size and the number of integers to print on each line.
Then create another additional function to the first program. The main function will prompt the user to enter an integer between 10 and 60 inclusive to search the array for. Call the user function pass the user function the array, array size and the entered number to search for. The function will return an unsigned int equal to the element/index number in the array where the match was found. If the user function does not find a match return -99. The main function will print two possible messages one that a match was found and the element number for the match, or print a message to indicate no match was found.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
