SELECTION
SORT
=========================================================================
CODE HERE👇👇
========================================================================
#include<stdio.h>
int main()
{
int i, j, count, temp, number[25];
printf("How many numbers u are going to enter?: ");
scanf("%d",&count);
// Loop to get the elements stored in array for(i=0;i<count;i++)
scanf("%d",&number[i]);
for(j=i+1;j<count;j++)
{
if(number[i]>number[j])
{
temp=number[i];
number[i]=number[j];
number[j]=temp;
}
}
}
for(i=0;i<count;i++)
printf(" %d",number[i]);
return 0;
}
=========================================================================
OUTPUT:-👇👇
========================================================================

Comments
Post a Comment