Kth smallest element in Array

C code to find out Kth smallest element in array .

Approach 1:

Sort the array using any sorting method and return the value of kth index.

Approach 2:

Using partition function of quick sort which return the index of the pivot value.

comparing the returning value from partition function with k.