Question: Classwork_1.5: Correct the C code that calls the function sort() to rearrange the array in ascending order. #include void sort(int*); { int a[5], *p; p=&a[0];

 Classwork_1.5: Correct the C code that calls the function sort() to

Classwork_1.5: Correct the C code that calls the function sort() to rearrange the array in ascending order. #include void sort(int*); { int a[5], *p; p=&a[0]; // same as referencing only a printf("Enter 5 integers "); for (int i=0;i *(a+i+1)) //checking if value in p>p+1 { temp = *(ati); // swaping the values *ati) = *(a+i+1); *(a+i+1)= temp: }

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