#include
int main()
{
//Ghanendra Yadav
int s,i,j,temp,a[20];
printf("Enter total elements: ");
scanf("%d",&s);
printf("Enter %d elements: ",s);
for(i=0;i scanf("%d",&a[i]);
for(i=0;i for(j=i+1;j if(a[i]>a[j]){
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
printf("After sorting is: ");
for(i=0;i printf(" %d",a[i]);
return 0;
}
Output:-
int main()
{
//Ghanendra Yadav
int s,i,j,temp,a[20];
printf("Enter total elements: ");
scanf("%d",&s);
printf("Enter %d elements: ",s);
for(i=0;i
for(i=0;i
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
printf("After sorting is: ");
for(i=0;i
return 0;
}
Output:-
0 Comments: