Skip to content

Commit

Permalink
Change for loop in gnome_sort.c, it's now C89-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrunofranco committed Aug 10, 2019
1 parent 8eb6ef2 commit bbf8f1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sorting/gnome_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ void display(int *array, int n)
int main()
{
int size = 6;
int i;
int *numbers = malloc(size*sizeof(int));
printf("Insert %d unsorted numbers: \n", size);
for (int i = 0; i < size; ++i)
for (i = 0; i < size; ++i)
scanf("%d", &numbers[i]);
printf("Initial array: ");
display(numbers, size);
Expand Down

0 comments on commit bbf8f1b

Please sign in to comment.