#include <iostream.h>
void main ()
{
int i,j,temp,smallest;
int list [10];
for (i=0;i<10;i++)
{
cout<<"enter a number\n";
cin>>list;
}
for (i=0;i<10;i++)
{
smallest=i;
for (j=i+1;j<10;j++)
{
if(list[j]<list[smallest])
smallest=j;
}
temp=list[smallest];
list[smallest]=list
list=temp;
{
for(i=0;i<10;i++)
cout<<list<<endl;
getch();
}
isayas 0 Newbie Poster
avarionist 1 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.