mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-14 05:44:36 +00:00
[PR #322] Changed main c #655
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/322
State: closed
Merged: No
#include<stdio.h>
void main(){
int n,a[50],i,j,temp;
printf("enter limit:");
scanf("%d",&n);
printf("enter elements:\n");
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n;i++){
for(j=0;j<n-i-1;j++){
if(a[j]>a[j+1]){
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
}