Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions