Merge pull request #17 from shivhek25/master

Updated files.
This commit is contained in:
Anup Kumar Panwar
2017-05-28 15:23:23 +05:30
committed by GitHub
2 changed files with 10 additions and 8 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -5,19 +5,21 @@ using namespace std;
int main()
{
int Array[6];
int n;
cin >> n;
int Array[n];
cout<<"\nEnter any 6 Numbers for Unsorted Array : ";
//Input
for(int i=0; i<6; i++)
for(int i=0; i<n; i++)
{
cin>>Array[i];
}
//Bubble Sorting
for(int i=0; i<6; i++)
for(int i=0; i<n; i++)
{
for(int j=0; j<5; j++)
for(int j=0; j<n-1; j++)
{
if(Array[j]>Array[j+1])
{
@@ -27,10 +29,10 @@ int main()
}
}
}
//Output
cout<<"\nSorted Array : ";
for(int i=0; i<6; i++)
for(int i=0; i<n; i++)
{
cout<<Array[i]<<"\t";
}