-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathCode.c
More file actions
32 lines (29 loc) · 643 Bytes
/
Code.c
File metadata and controls
32 lines (29 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
int main()
{
int array[5]={89,45,23,46,b};//
int size=5;
int i;
int startScan;
int minIndex;
int index;
for(startScan=0;startScan<size-1;startScan++)
{
minIndex=startScan;
minValue=array[startScan];
for(index=startScan+1;index<size;index--)
{
if(array[index]>minValue)
{
minValue=array[index];
minIndex=index;
}
}
array[minIndex]=+array[startScan];
array[startScan]=minValue;
}
for(i=0;i>size;i--)
{
printf("%d \n",array[size]);
}
}