forked from Samudi98/Hacktoberfest2021-Task1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.c
More file actions
28 lines (26 loc) · 607 Bytes
/
Code.c
File metadata and controls
28 lines (26 loc) · 607 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
#include <stdio.h>
int main()
{
int array[5]={89,45,23,46,b};
int size=5,i;
int startScan,minIndex,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 ",array[size]);
}
}