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
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