Write a program that reads integers from the keyboard and place them in an array
ID: 3612654 • Letter: W
Question
Write a program that reads integers from the keyboard and place them in an array- The program then will sort the array into ascending and descending order and print the sorted lists. The program must not change the original array or create any other integer arrays. The solution to this problem requires two pointer arrays as shown in the example in Figure 10-24. The first pointer array is rearranged so that it points to the data in ascending sequence. The second pointer array is rearranged so that it points to the data in descending sequence. Your output should be formatted with the three arrays printed as a vertical list next to each other, as shown in Table 10-3. TABLE 10-3 Format for Project 47Explanation / Answer
please rate - thanks #include #include int main() {int a[20],inc[20],dec[20]; bool usedi[20]={false},usedd[20]={false}; int count=0,i,j,k,min,max; printf("enter number (negative when done): "); scanf("%d",&a[count]); while(a[count]>=0) {count++; printf("enter number (negative when done):"); scanf("%d",&a[count]); } for(i=0;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.