Mam pytanie w jaki sposób zmienić pętlę for na while?
#include<stdio.h>
main()
{
int i,j;
int s=8;
int temp;
int a[8] = {8, 1, 4, 6, 2, 9, 5, 7};
for(i=0; i<s; i++)
{
for(j=i+1; j<s; j++)
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0; i<s; i++)
printf(" %d",a[i]);
return 0;
}