Question
Write a C program to sort 10 integers in ascending or descending order with respect to the users choice (a or d). For sorting these
Write a C program to sort 10 integers in ascending or descending order with respect to the users choice (a or d). For sorting these integers, define and use the function having the prototype below:
void bubbleSort(int *array, char order);
In main function, array values must be filled with random integers in the interval [-100, 100] and printed on the screen. Additionally, getting the input from user and printing the final values of the array must be performed in the main function.
EXAMPLE OUTPUT :
10 random numbers generated = 21 -97 -61 54 -81 23 77 -4 46 12
Enter the sorting order (a or d): d
-----------------------------------
Values in DESCENDING order = 77 54 46 23 21 12 -4 -61 -81 -97
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started