[PR #322] Changed main c #655

Open
opened 2026-01-29 15:14:22 +00:00 by claunia · 0 comments
Owner

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;
}
}
}

   for(i=0;i<n;i++)
    printf("%d\n",a[i]);

}

**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; } } } for(i=0;i<n;i++) printf("%d\n",a[i]); }
claunia added the pull-request label 2026-01-29 15:14:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#655