a53

kth

a53
Nov 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. int Kth(int a[],int n,int x,int k)
  2. {
  3. if(k==0)
  4. return -1;
  5. for(int i=0;i<n;++i)
  6. {
  7. if(x==a[i])
  8. --k;
  9. if(k==0)
  10. return i;
  11. }
  12. return -1;
  13. }
Add Comment
Please, Sign In to add comment