Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions HelloWorld/helloworld.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include<stdio.h>
#include<iostream>
int main()
{
printf("Hello World!");
}
#include<stdio.h>
#include<iostream>

int main()
{
printf("Hello World!");
}

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,5 @@ Fork this project and add your username + profile link to the [Census](https://g
- [Soubhik Rakshit](https://github.com/soubh1k)
- [Jasen Wyatt](https://github.com/jasenwyatt)
- [Shubham Sharma](https://github.com/downfall3597)
- [Akash Solanki](https://github.com/akashsolanki1101)

27 changes: 27 additions & 0 deletions algorithms/bubble_sorting/cpp/Bubble.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
#define parr(arr,s) for(int i=0;i<s;cout<<arr[i++]<<" ");cout<<endl;
#define sarr(arr,s) for(int i=0;i<s;cin>>arr[i++]);

using namespace std;

void bubble(int arr[],int n){
for(int i=0;i<n-1;i++){
int flag=0;
for(int j=0;j<n-i-1;j++){
if(arr[j]>arr[j+1]){
swap(&arr[j],&arr[j+1]);
flag=1;
}
}
if(flag==0) break;
}
}

int main(){
int arr[5];
sarr(arr,5);

bubble(arr,5);

parr(arr,5);
}