mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 13:31:21 +03:00
Update BubbleSort.c
This program takes the number of elements to be sorted as an input from the user. I think it may be better if we use this.
This commit is contained in:
parent
6f651d147c
commit
03acb2b1ea
@ -7,11 +7,13 @@
|
|||||||
|
|
||||||
#include<stdio.h>
|
#include<stdio.h>
|
||||||
#include<conio.h>
|
#include<conio.h>
|
||||||
#define SIZE 7
|
#include<stdlib.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int i,j,temp;
|
int i,j,temp,SIZE;
|
||||||
int arr[ SIZE ];
|
printf("Enter number of elements to be sorted : ");
|
||||||
|
scanf("%d",&SIZE);
|
||||||
|
int *arr = (int*)malloc(SIZE*sizeof(int));
|
||||||
for(i=0; i<SIZE; i++)
|
for(i=0; i<SIZE; i++)
|
||||||
{
|
{
|
||||||
printf("Enter Number : ");
|
printf("Enter Number : ");
|
||||||
|
Loading…
Reference in New Issue
Block a user