Skip to content

Commit 4549714

Browse files
Update Bubblesort
1 parent 6b217d6 commit 4549714

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

C++/Bubblesort

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/* C++ Program - Bubble Sort */
22

3-
#include<iostream.h>
4-
#include<conio.h>
5-
void main()
3+
#include<bits/stdc++.h>
4+
using namespace std;
5+
int main()
66
{
7-
clrscr();
8-
int n, i, arr[50], j, temp;
7+
8+
int n, i, j, temp;
99
cout<<"Enter total number of elements :";
1010
cin>>n;
11+
int arr[n];
1112
cout<<"Enter "<<n<<" numbers :";
1213
for(i=0; i<n; i++)
1314
{
@@ -32,5 +33,5 @@ void main()
3233
{
3334
cout<<arr[i]<<" ";
3435
}
35-
getch();
36+
return 0;
3637
}

0 commit comments

Comments
 (0)