Question: Write a C program named lab5.c that sorts the following array of integers in an ascending order where N is a constant equal to 10

Write a C program named "lab5.c" that sorts the following array of integers in an ascending order where N is a constant equal to 10 declared using a #define macro:

int a[N] = { 76, 342, 53, 234, 1, 67, 98, 23, 45, 100 };

The swapping algorithm in your program must be implemented within a function named swap() with the following prototype exactly:

void swap(int* a, int* b);

The swap() function must be used correctly in your main() function. Furthermore, your main() function must use a for loop to display the sorted elements of the a array onto the screen

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 Programming Questions!