Hi. I was wondering if any one could help me with this program. I didn't get any error messages. It was excecuted but the output was incorrect. I got Unordered data: 7 3 66 3 -5 22 -77 2 After pass 1: 7 3 66 3 -5 22 -77 2 and After pass 2: 7 7 7 7 7 7 7 7. The output should be Unordered data: 7 3 66 3 -5 22 -77 2 After pass1: -77 7 66 3 3 22 -5 2 After pass 2: -77 -5 66 7 3 22 3 2.

Recommended Answers

All 2 Replies

>void transpo_sort(int a[], int i);
This doesn't call the transpo_sort function, it declares the transpo_sort function. In other words, absolutely nothing is happening to your array.

>printf("After Pass #2:%7d,%5d,%5d,%5d,%5d,%5d,%5d,%5d \n", a,a,a,a,a,a,a,a);
i is 0, and a[0] is 7. It's no surprise that printing a eight times gives you eight 7's.

Also it is better if you post the code here than attaching an word doc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.