0

#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();
}

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by avarionist
0

please use code tags "

also what problem are you having exactly i cant decipher the title so .....
care to elaborate ?

Edited by Reverend Jim: Fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.