2. Write a program to sort an array of integers of size n in ascending/increasin
ID: 3630427 • Letter: 2
Question
2. Write a program to sort an array of integers of size n in ascending/increasing order of values. Test the program on the following set of input values: 4, 67, -2, 0, 489, 23, -17, 32, 5, and 120. Use only while and do-while statements for loop construction (do not use for statements). You must accept the set of values from the keyboard with proper prompts, and display the input values as entered first and then display the sorted values on the screen. You must ask the user first the size of the set (number of values needed to be sorted) and adjust the computation accordingly. Use proper type declaration. PLEASE INCLUDE COMMENT AND WHAT YOU ARE DOING TO EXPLAIN EACH STEP THANK YOUExplanation / Answer
#include using namespace::std; int main(){ int n,i; int *pinakas; cout >n; pinakas=new int(n); i=0; while(iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.