Commit 3e981cab by emonyi

Upload New File

parent f85f562e
Showing with 40 additions and 0 deletions
#include <stdio.h>
#include <math.h>
int main(){
int N;
int i;
int j;
printf("Please enter the N value\n");
scanf("%d", &N);
int array[N];
for(i=0; i < N; i++){
scanf("%d", &array[i]);
}
int swap;
i = 0;
while(i < N){
j = 0;
while(j < N-1){
while(array[j] < array[j + 1]){
swap = array[j];
array[j] = array[j + 1];
array[j + 1] = swap;
}
j++;
}
i++;
}
for(i=0; i < N; i++){
printf("%d ", 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