The problem is somewhere in your quicksort algorithm. Testing your code with 100 elements, seems to complete. BUT the output is not perfectly sorted.
Enter the number of elements
100
0 99
0 20
0 1
3 20
3 7
3 5
3 4
9 20
9 16
11 16
13 16
15 16
18 20
22 99
22 41
22 26
22 25
24 25
28 41
28 32
29 32
30 32
30 31
34 41
34 35
37 41
38 41
38 39
43 99
43 47
43 45
43 44
49 99
49 96
50 96
50 52
54 96
54 76
54 57
55 57
59 76
59 60
62 76
62 74
62 64
63 64
66 74
66 67
69 74
70 74
70 72
71 72
78 96
80 96
80 84
80 83
82 83
86 96
86 91
86 88
87 88
90 91
93 96
93 94
98 99
39 117 363 538 420 582 587 604 679 691
849 862 986 1161 1176 1187 1179 1206 1266 1422
1702 1982 2025 2071 2076 2080 2126 2458 2471 2494
2562 2758 2820 3169 3493 3205 3532 3602 3635 3691
3989 4018 4046 4216 4065 4221 4358 4376 4392 4469
4641 4756 4781 4848 4871 4959 5002 5152 5339 5561
5516 5617 5666 5789 5828 5900 5977 5977 6169 6481
6692 6934 6743 6937 7062 7155 7283 7329 7343 7686
7737 7812 7904 7892 8040 8295 8389 8859 8756 9036
9051 9342 9379 9407 9540 9603 9627 9777 9901 9932
Press any key to continue . . .
Look at the first row... 420 is misplaced