Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sortiraj(int a[], int n, char e)
- {
- int temp;
- for(int i=0;i<n;i++)
- {
- for(int j=n;j>i;j--)
- {
- if(e == '>')
- {
- if(a[j]<a[j-1])
- {
- temp = a[j];
- a[j] = a[j-1];
- a[j-1] = temp;
- }
- }
- else
- {
- if(a[j]>a[j-1])
- {
- temp = a[j];
- a[j] = a[j-1];
- a[j-1] = temp;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement