include
include
int main()
{
int a[100]={0},i=0,j=0,n,temp=0;
printf("\nEnter the number of inputs");
/*Getting inputs*/
for(i=0;;i++)
{ if(a[i]<100)
scanf("%d",&a[i]);
if(a[i]==42)
{
n=i;
break;
}
}
/*Arranging the outputs in ascending order*/
for(i=0;i<n;i++)
{
for(j=0;j<(n-i-1);j++)
{if(a[i]>a[i++])
{
temp=a[i];
a[i]=a[i++];
a[i]=temp;
}
}
}
/*Printing the outputs*/
for(i=0;i<n;i++)
printf("%d\n",a[i]);
return 0;
}