Commit 5ad97312 by ilahma

Upload New File

parent 970c09c7
Showing with 31 additions and 0 deletions
#include <stdio.h>
int main() {
int i;
int j;
int swap=0;
int N;
printf("PLease, enter array size: ");
scanf("%d", &N);
int array[N];
for(i=0;i<N;i++) {
printf("Please, enter element of the array :\n\n");
scanf("%d",&array[i]); }
for(i=0;i<N;i++) {
for(j=0;j<N-1;j++){
if(array[j]<array[j+1]){
swap=array[j];
array[j]=array[j+1];
array[j+1]=swap;
}
}
}
for(i=0; i<N; i++){
printf("%d\n",array[i]);
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment