Write a program to implement selection sort in c

Write a program to implement selection sort in c. This is a sorting program using the concept of selection sorting in C. The selection sort program is done by the value of the sorting element will be selected before the programs output, this process is known as selection sorting in c programming language

#include<stdio.h>
int main()
{
int i, j, count, temp, num[10];
printf("How many nums");
scanf("%d",&count);
printf("Enter %d elements: ", count);
for(i=0;i<count;i++)
scanf("%d",&num[i]);
for(i=0;i<count;i++)
{
for(j=i+1;j<count;j++)
{
if(num[i]>num[j])
{
temp=num[i];
num[i]=num[j];
num[j]=temp;
}
}
}
printf("After sorting");
for(i=0;i<count;i++)
printf(" %d",num[i]);
return 0;
}

 

Output:

How many nums

5

Enter 5 elements:

45 67 78 89 34

After sorting 

34 45 67 78 89